Light arrow

I spent hours trying to make the arrow below, using drawables, using all kinds of spins without any success, it just never looked like this:

The insanely difficult arrow

Is it possible to do this with shape / layer-list without using png?

* EDIT *

The closest I could get to the right arrow. I could never match strings and NOT overlap:

My best try

+4
source share
1 answer

perhaps this is what you are looking for

arrow.xml

    <?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="100%"
            android:pivotY="50%"
            android:toDegrees="-45">
            <shape
                android:shape="line">
                <stroke
                    android:width="3dp"
                    android:color="@android:color/holo_green_light"
                    />
            </shape>
        </rotate>
    </item>

    <item>
        <rotate
            android:fromDegrees="45"
            android:pivotX="100%"
            android:pivotY="50%"
            android:toDegrees="45">
            <shape
                android:shape="line">
                <stroke
                    android:width="3dp"
                    android:color="@android:color/holo_green_light"
                    />
            </shape>
        </rotate>
    </item>
</layer-list>

if you have edges that do not stick, you can add top and bottom to the elements, so for the first add <item android:bottom="5dp">for the second <item android:top="4dp">....

+8
source

All Articles