How to create shape in android using xml? and can we arrange those triangles as circle?
Try this
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/rightArrow">
<rotate
android:fromDegrees="45"
android:toDegrees="45"
android:pivotX="-40%"
android:pivotY="87%" >
<shape
android:shape="rectangle" >
<stroke android:color="@android:color/transparent" android:width="10dp"/>
<solid
android:color="#000000" />
</shape>
</rotate>
</item>
</layer-list>
For the desired direction of triangle you can play with the degrees and pivotx/y points
e.g
<rotate
android:fromDegrees="220"
android:toDegrees="0"
android:pivotX="35%"
android:pivotY="5%" >
<shape
android:shape="rectangle" >
<stroke android:color="#000000" android:width="1dp"/>
<solid
android:color="#000000" />
</shape>
</rotate>
will give you 'v' shaped triangle
alternate for rotate this property also given v shape triangle
android:rotation="180"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With