您的位置:首页 > 移动开发 > Android开发

android给view比如layout等添加阴影效果

2014-06-20 14:49 316 查看
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity"

android:background="#e5e5e5">

<RelativeLayout

android:layout_width="fill_parent"

android:layout_height="match_parent"

android:background="@android:drawable/toast_frame"

android:padding="4dp" > //经测试,这里一定要设置,不然这上面覆盖的白色背景无法全部覆盖@android:drawable/toast_frame的黑色背景

<LinearLayout

android:layout_width="fill_parent"

android:layout_height="match_parent"

android:background="#FFFFFF"

android:padding="13dp" >

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:text="Sombra no estilo Toast"

android:textColor="#707070" />

</LinearLayout>

</RelativeLayout>

</RelativeLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: