繁体   English   中英

获取可绘制背景布局上的Facebook阴影效果

[英]Getting the Facebook Shadow Effect on Background Layout Drawable

我想实现此阴影效果作为我的RelativeLayout的背景可绘制对象:

在此处输入图片说明

我正在尝试在我的布局中获得指定的效果。 描述如下:

答: RelativeLayout 周围有轻微中风

B:布局下阴影和轻微的阴影,以左,右的布局

到目前为止,我有:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#CABBBBBB"/>
            <corners android:radius="2dp" />
        </shape>
    </item>

    <item
        android:left="0dp"
        android:right="0dp"
        android:top="1dp"
        android:bottom="1dp">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white"/>
            <corners android:radius="2dp" />
        </shape>
    </item>
</layer-list>

我还应该添加什么才能获得显示的结果?

您也可以使用CardView

http://developer.android.com/training/material/lists-cards.html

只需添加自己的海拔,就可以开始了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM