zoukankan      html  css  js  c++  java
  • 安卓 drawable xml 实现多边框背景

     Android drawable xml 实现多边框背景。

    test.xml

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    
        <!-- 第一个item代表的是显示在最外层的边框背景 -->
        <item>
            <shape android:shape="rectangle">
                <solid android:color="#CF0808" />
                <corners
                    android:bottomLeftRadius="2dp"
                    android:bottomRightRadius="2dp"
                    android:topLeftRadius="2dp"
                    android:topRightRadius="2dp" />
            </shape>
        </item>
        <!--阴影-->
    
        <!-- 第二个item代表的是显示在第二层的边框背景 -->
        <item
            android:top="3dp"
            android:right="3dp"
            android:left="3dp"
            android:bottom="3dp">
            <shape android:shape="rectangle">
                <solid android:color="#2CCF08" />
                <corners
                    android:bottomLeftRadius="2dp"
                    android:bottomRightRadius="2dp"
                    android:topLeftRadius="2dp"
                    android:topRightRadius="2dp" />
            </shape>
        </item>
        <!--阴影-->
    
    
        <!--白色背景-->
        <item
            android:top="6dp"
            android:right="6dp"
            android:left="6dp"
            android:bottom="6dp">
            <shape android:shape="rectangle">
                <padding android:bottom="6dp" android:top="6dp" android:left="6dp" android:right="6dp"/>
                <solid android:color="#ffffff" />
                <corners
                    android:bottomLeftRadius="2dp"
                    android:bottomRightRadius="2dp"
                    android:topLeftRadius="2dp"
                    android:topRightRadius="2dp" />
            </shape>
        </item>
    
    </layer-list>

    用法:android:background="@drawable/test"

  • 相关阅读:
    SHELL种类,版本及选择
    delete
    ctrl+alt+l:linux 锁屏 win+l:windows锁屏
    inux关于readlink函数获取运行路径的小程序
    网络版shell之网络编程练习篇--telnet服务端
    CentOS 6.5配置nfs服务
    linux操作系下RAR的使用
    BLOB二进制对象(blob.c/h)
    循环队列
    java的System.getProperty()方法能够获取的值
  • 原文地址:https://www.cnblogs.com/blogzhangwei/p/14944538.html
Copyright © 2011-2022 走看看