像这样的抽象形状

时间:2017-10-23 11:13:11

标签: android

我想在drawable xml文件中绘制自定义形状。那么代码是什么呢?

enter image description here

1 个答案:

答案 0 :(得分:2)

试试这个:

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:bottom="3dp"
        android:left="-22dp"
        android:right="3dp"
        android:top="3dp">
        <shape android:shape="rectangle">
            <solid android:color="@color/transperent" />

            <stroke
                android:width="2dp"
                android:color="@color/black" />
        </shape>
    </item>


</layer-list>