<shape>
我正在尝试在 android drawable xml 中的一个元素中的一个矩形上有效地实现 2 次笔划。一条深绿色的外线和一条浅绿色的内线,中间有一个渐变填充。我的代码目前如下所示:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="3px" android:color="#477135" />
</shape>
</item>
<item >
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#81c557" android:endColor="#539942"
android:angle="270" />
<stroke android:width="1px" android:color="#a8d78a" />
</shape>
</item>
我尝试将 android:top="3px" android:bottom="3px" 应用到第二个 item 元素,但是当我添加 right & left 属性时,整个东西都不会渲染。注意,这都是在 ListView 中完成的