我能够将边框绘制为线性布局,但它的四面都被绘制了。我只想将其限制在右侧,就像在CSS中一样(border-right:1px纯红色;)。
我已经尝试过了,但是它仍然可以吸引所有方面:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape android:shape="rectangle" >
<stroke
android:height="2dp"
android:width="2dp"
android:color="#FF0000" />
<solid android:color="#000000" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="1dp"
android:top="0dp" />
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="5dp"
android:radius="1dp"
android:topLeftRadius="5dp"
android:topRightRadius="0dp" />
</shape>
</item>
关于如何做到这一点的任何建议?
顺便说一句,我不想使用将宽度为1dp的视图放在所需侧面的技巧。