我阅读了一些教程,但我只能实现在一侧或两侧使用相同颜色的边框。我试图创建一个样式来应用上边框与不同颜色和宽度的下边框。
因此,我希望顶部有一个2dp的蓝色边框,底部有一个3dp的红色边框。
这是我正在使用的用于应用顶部和底部边框的样式,但我不能更改顶部或底部的颜色。
<?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:width="1dp" android:color="#FF000000" />
<solid android:color="#FFDDDDDD" />
</shape>
</item>
<item android:top="1dp" android:bottom="1dp">
<shape
android:shape="rectangle">
<stroke android:width="1dp" android:color="#FFDDDDDD" />
<solid android:color="#00000000" />
</shape>
</item>
</layer-list>