当前位置:   article > 正文

Android 复习layer-list使用

Android 复习layer-list使用
 <shape android:shape="rectangle"> 
<size android:width="1dp" android:height="100px" /> 
<solid android:color="#FFFFFF" /> 
</shape>
通过shape画线段,通过 <item android:gravity="left|top">控制线段的具体位置

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:gravity="left|top">
        <shape android:shape="rectangle">
            <size
                android:width="1dp"
                android:height="100px" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="left|bottom">
        <shape android:shape="rectangle">
            <size
                android:width="1dp"
                android:height="100px" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="right|top">
        <shape android:shape="rectangle">
            <size
                android:width="1dp"
                android:height="100px" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="right|bottom">
        <shape android:shape="rectangle">
            <size
                android:width="1dp"
                android:height="100px" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>

    <item android:gravity="bottom|right">
        <shape android:shape="rectangle">
            <size
                android:width="100px"
                android:height="1dp" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="bottom|left">
        <shape android:shape="rectangle">
            <size
                android:width="100px"
                android:height="1dp" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="top|right">
        <shape android:shape="rectangle">
            <size
                android:width="100px"
                android:height="1dp" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="top|left">
        <shape android:shape="rectangle">
            <size
                android:width="100px"
                android:height="1dp" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="center_horizontal|bottom">
        <shape android:shape="rectangle">
            <size
                android:width="100px"
                android:height="1dp" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="center_horizontal|top">
        <shape android:shape="rectangle">
            <size
                android:width="100px"
                android:height="1dp" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="center_vertical|left">
        <shape android:shape="rectangle">
            <size
                android:width="1dp"
                android:height="100px" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
    <item android:gravity="center_vertical|right">
        <shape android:shape="rectangle">
            <size
                android:width="1dp"
                android:height="100px" />
            <solid android:color="#FFFFFF" />
        </shape>
    </item>
</layer-list>
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/酷酷是懒虫/article/detail/788729
推荐阅读
相关标签
  

闽ICP备14008679号