1
我嘗試添加自定義背景在我CardView.This是我的源CardView自定義背景
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/item_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ff00"
android:orientation="vertical">
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="12dp"
card_view:cardElevation="12dp"
card_view:cardPreventCornerOverlap="false"
card_view:contentPadding="0dp"
android:layout_margin="16dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#cccccc">
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
正如你可以看到成Cardview我有LinearLayout中和RelativieLayout.RelativeLayout的背景色爲# cccccc,但是cornerradius和elevetion不能用自定義背景顏色(請看我的圖片) 我怎麼能解決我的問題?
它是一個可以改變背景顏色沒有利潤?我的意思是保證金是左右? @Vivek Mishra – BekaKK
我認爲使用像這樣的圖像作爲你的cardview背景會更好。 –
ccccc顏色的實例? @Vivek Mishra – BekaKK