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>
请将您的布局发布在问题本身。请不要链接到异地。 –