![](/img/trans.png)
[英]ListView rounded corner hidden by list item's background image in android
[英]Rounded corner of list item on Android?
如何设置属性以实现ListView
每个项目的圆角? 如果可以的话,请举个例子,谢谢!
例如: http : //www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/
编辑:这是我的代码在这里的答案。
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#ffff"
android:endColor="#fddd"
android:angle="270" />
<corners
android:radius="13dp" />
<stroke
android:width="1dp"
android:color="#feee" />
</shape>
您可以使用形状来实现。
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:radius="12dp"/>
<stroke
android:width="1dp"
android:color="@color/blue" />
</shape>
corner元素指定圆角的大小。 现在,您需要做的就是指定此drawable作为每个列表元素的背景。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.