使用XML的Android Downward Facing Arrow

时间:2016-05-02 07:02:06

标签: android xml

如何仅在Android中使用XML编写面向下的三角形?

我需要什么:

enter image description here

这是我尝试的但最终形状奇怪:

<?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="-40%"
            android:pivotY="87%" >
            <shape
                android:shape="rectangle" >
                <stroke android:color="#5F82D2" android:width="10dp"/>
                <solid
                    android:color="#5F82D2" />
            </shape>
        </rotate>
    </item>
</layer-list>

1 个答案:

答案 0 :(得分:0)

试试这个:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
    <rotate
        android:fromDegrees="45"
        android:pivotX="230%"
        android:pivotY="27%"
        android:toDegrees="45" >
        <shape android:shape="rectangle" >
            <stroke
                android:width="10dp"
                android:color="#00000000" />

            <solid android:color="#00ACED" />
        </shape>
    </rotate>
</item>
</layer-list>

This is what i got