android 给view添加阴影

1、方法一:

      使用 CardView 布局

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardBackgroundColor="#ffffff"
app:cardCornerRadius="4dp"
app:cardElevation="3dp">

2、方法二:
使用属性 android:elevation="3dp"
posted @ 2019-01-18 13:37  你好and程序员  阅读(649)  评论(0编辑  收藏  举报