0
嗨我一直在這個應用程序上工作了大約一個月,今天我決定在前棒棒糖設備上進行測試,並且在CardView顯示時我得到了不同的結果。這裏的結果linkAndroid上的棒棒糖設備上的CardView問題
這裏的形象是我的XML佈局
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/CardViewCustom"
xmlns:card="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/listRestaurantContainer"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="vertical"
card:cardCornerRadius="4dp"
card:cardElevation="4dp">
<RelativeLayout
android:padding="8dp"
android:background="@drawable/btn_cardview_background"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/imgWrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img"
android:layout_width="120dp"
android:layout_height="120dp"
tools:src="@mipmap/ic_launcher" />
<ProgressBar
android:id="@id/progress"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true">
<View
android:id="@+id/squareReview"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_gravity="center"
android:background="@drawable/review_square" />
<TextView
android:id="@+id/rating"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
</FrameLayout>
<TextView
android:id="@+id/title"
style="@style/CardViewText.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="35dp"
android:layout_marginRight="35dp"
android:layout_toEndOf="@+id/imgWrapper"
android:layout_toRightOf="@+id/imgWrapper"
android:ellipsize="end"
android:gravity="top"
android:paddingLeft="6dp"
android:paddingStart="6dp" />
<TextView
android:id="@+id/category"
style="@style/CardViewText.Category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_toEndOf="@+id/imgWrapper"
android:layout_toRightOf="@+id/imgWrapper"
android:gravity="top"
android:paddingEnd="50dp"
android:paddingLeft="6dp"
android:paddingRight="50dp"
android:paddingStart="6dp" />
<TextView
android:id="@+id/address"
style="@style/CardViewText.Address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/category"
android:layout_toEndOf="@+id/imgWrapper"
android:layout_toRightOf="@+id/imgWrapper"
android:gravity="top"
android:paddingEnd="50dp"
android:paddingLeft="6dp"
android:paddingRight="50dp"
android:paddingStart="6dp" />
</RelativeLayout></android.support.v7.widget.CardView>
請將您的佈局發佈在問題本身。請不要鏈接到異地。 –