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"

android 给view添加阴影

上一篇:AndroidStudio_Button


下一篇:移动端 上传头像 并裁剪功能(h5)