指定邊框線條铲觉,需要顯示線條的邊設(shè)置為正值stroke 的width撵幽。
不顯示的邊設(shè)置為 負(fù)值 stroke 的width。
底部邊框
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#FFF" />
</shape>
</item>
<item
android:bottom="1px"
android:left="-2px"
android:right="-2px"
android:top="-2px">
<shape>
<stroke
android:width="1px"
android:color="#FF0000" />
</shape>
</item>
</layer-list>
Paste_Image.png
左邊和底部
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="#FFF" />
</shape>
</item>
<item
android:bottom="1px"
android:left="-1px"
android:right="-2px"
android:top="-2px">
<shape>
<stroke
android:width="1px"
android:color="#FF0000" />
</shape>
</item>
</layer-list>
Paste_Image.png