【发布时间】:2020-07-01 12:16:18
【问题描述】:
我想在 Android Studio 中将背景颜色更改为我的 CardView,我想使用选择器,但我不知道该怎么做
这在我的代码中:
<androidx.cardview.widget.CardView
android:id="@+id/card_ordina"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="15dp"
app:cardBackgroundColor="@color/orange"
app:cardCornerRadius="20dp">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="40dp"
android:background="@drawable/options"
android:backgroundTint="#F44336"
android:padding="10dp"
android:src="@drawable/carrello"
android:tint="@color/background" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:layout_marginBottom="5dp"
android:fontFamily="@font/title"
android:text="ORDINA"
android:textColor="@color/background"
android:textSize="18sp" />
</androidx.cardview.widget.CardView>
【问题讨论】:
标签: android selector android-cardview