我花了数小时尝试使用各种旋转方式制作下面的箭头,但毫无成功,它看起来根本不像这样:
使用shape/layer-list而不使用png,是否有可能制作出它?
*编辑*
我能做到最接近期望箭头的是这个。但我永远不能使线条匹配而且不重叠:
*编辑*
我能做到最接近期望箭头的是这个。但我永远不能使线条匹配而且不重叠:
箭头.xmlarrow.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>
如果您的边缘没有粘合,您可以为元素添加顶部和底部。对于第一个元素,请添加<item android:bottom="5dp">
,对于第二个元素,请添加<item android:top="4dp">
。