cardview阴影颜色
时间: 2023-07-29 12:06:19 浏览: 50
CardView 的阴影颜色可以通过设置 CardView 的 `cardBackgroundColor` 和 `cardElevation` 属性来实现。具体的实现代码如下所示:
```xml
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:cardBackgroundColor="#FFFFFF"
app:cardElevation="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<!-- CardView 内容部分 -->
</LinearLayout>
</android.support.v7.widget.CardView>
```
在上面的代码中,`cardBackgroundColor` 属性用于设置 CardView 的背景颜色,`cardElevation` 属性用于设置 CardView 的阴影深度。你可以根据自己的需要分别调整这两个属性的值,以达到理想的效果。