如何使用描边设置矩形的不同颜色边框

5

如果只是想使用描边来获取上边框或左边框,那么有没有可能为不同的边框设置不同的宽度?


你需要在问题中添加更多细节。你所说的“using stroke”是什么意思?你标记了Android,这意味着你正在Android中显示某些内容?是使用openGL吗? - Cheryl Simon
1个回答

8
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="10dp">
 <solid android:color="#FAFAFA"/>
 <stroke android:width="1px" android:color="#cccccc" />
 <corners android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp" 
     android:topLeftRadius="0dp" android:topRightRadius="0dp"
/>

</shape>

希望您能够查看我正在使用的XML。谢谢。

它是否也使用不同的颜色来表示矩形的不同边? - Bugs Happen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接