我有一个TextView,我想在它的顶部和底部边缘上添加不同颜色的边框。我知道如果要添加单一颜色的边框,我们可以使用以下代码:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000"/>
</shape>
</item>
<item
android:top="1dp" android:bottom="1dp">
<shape android:shape="rectangle">
<solid android:color="#ffffff"/>
</shape>
</item>
但如果我们需要不同颜色的边,该怎么做呢?