我正在使用谷歌的 cardView 支持库来实现我的卡片功能。它在 KitKat 及之后版本中运行良好,但是在 4.1.2 设备上,卡片的背景被设置为黑色,并且填充/边距不被应用。
<android.support.v7.widget.CardView
android:id="@+id/all_goals_card_view"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:padding="10dp"
app:cardCornerRadius="4dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardBackgroundColor="@android:color/white"
>
</android.support.v7.widget.CardView>