生成特定的xml drawable

时间:2017-08-09 12:12:37

标签: android xml

如何在forml中为xml制作这样的drawable? 我正在考虑使用图层列表,但它似乎不起作用:

这是我现在所拥有的:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
    <item>
        <rotate
            android:fromDegrees="45"
            android:toDegrees="45"
            android:pivotX="0%"
            android:pivotY="100%" >
            <shape
                android:shape="rectangle" >
                <stroke android:color="@android:color/transparent" android:width="10dp"/>
                <solid
                    android:color="@color/colorPrimary" />
            </shape>
        </rotate>
    </item>
    <item>
        <rotate
            android:fromDegrees="-45"
            android:toDegrees="45"
            android:pivotX="0%"
            android:pivotY="0%" >
            <shape
                android:shape="rectangle" >
                <stroke android:color="@android:color/transparent" android:width="10dp"/>
                <solid
                    android:color="@color/colorPrimary" />
            </shape>
        </rotate>
    </item>
    <item>
            <shape
                android:shape="rectangle" >
                <stroke android:color="@android:color/transparent" android:width="10dp"/>
                <solid
                    android:color="@color/colorPrimary" />
            </shape>



    </item>

</layer-list>

这就是我需要的:

enter image description here

如何实现这样的目标呢? 或者是否有这种形状的在线生成器?

0 个答案:

没有答案