Android上列表项的圆角?
如何设置属性以实现ListView中每个项目的圆角? 如果可以,请给出一个例子,谢谢 例如: 编辑: 这是我的密码Android上列表项的圆角?,android,listview,rounded-corners,Android,Listview,Rounded Corners,如何设置属性以实现ListView中每个项目的圆角? 如果可以,请给出一个例子,谢谢 例如: 编辑: 这是我的密码 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#ffff" android:endColor="#fd
<?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>
您可以通过形状来实现这一点
拐角元素指定圆角的大小。现在,您所需要做的就是指定这个可绘制元素作为每个列表元素的背景。您可以通过形状来实现这一点 拐角元素指定圆角的大小。现在,您需要做的就是指定这个drawable作为每个列表元素的背景
<?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>