ListView边框颜色
是否可以在 ListView 周围创建 1px
宽度的彩色边框?
我尝试了以下编码:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#BFFFFFFF" android:endColor="#BFFFFFFF" />
<corners android:bottomRightRadius="10dp" android:radius="10dp"
android:bottomLeftRadius="10dp" android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
那么...有谁知道我如何制作边框线并设置其颜色?
PS:我确实在另一篇文章中搜索过这个问题,但没有成功,这就是我创建这个问题的原因。
谢谢!
Is it possible to create a 1px
width, colored border around a ListView?
I tried the following coding:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#BFFFFFFF" android:endColor="#BFFFFFFF" />
<corners android:bottomRightRadius="10dp" android:radius="10dp"
android:bottomLeftRadius="10dp" android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
So... does anyone know how I can make a border line and set its color?
PS: I really searched for this issue in another posts and no success, that's why I created this one.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的。只需添加
标签,如下所示。请使用 1dp 而不是 1px,您可以根据需要替换任何边框颜色。
Yes, it is possible. Just add the
<stroke>
tag as shown belowPlease use 1dp instead of 1px and you can replace any border color as you wish for.