我有带圆角的 ListView 。如何设置这些角的背景?我需要将它们设置为灰色,就像主背景一样,但它们是白色的。
我的 ListView
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cats_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#000"
android:background="@drawable/round_corners"
/>
round_corners.xml :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp"
android:topLeftRadius="17dp" android:topRightRadius="17dp"/>
<gradient
android:angle="180"
android:endColor="#ff0000"
android:startColor="#ff0000"
android:type="linear" />
</shape>
最佳答案
是否可以将 xml 形状的背景设置为透明? 可以使用系统默认
@android:color/transparent
关于Android:listview角落的背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11363564/