开发者

How to change the background color of this ListView?

I have a ListV开发者_如何学编程iew whose background is the following drawable (for rounded corner goodness):

    <?xml version="1.0" encoding="UTF-8"?> 
<item android:drawable="@color/white"> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
        android:shape="rectangle" 
        android:angle="90"
        android:color="#FFFFFF"> 

        <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" 
        android:topLeftRadius="7dp" android:topRightRadius="7dp"
        android:color="#FFFFFF"/> 
    </shape> 
</item>

The background is black however. How can I get it to be white?


In the xml where you have defined shape surround with this,

        
   < item android:drawable="@color/black">       
    shape code ...
   </item>

Define color value (black) in res/values/colors.xml

update:

< selector  xmlns:android="http://schemas.android.com/apk/res/android">
< item android:drawable="@color/black""> 
    < shape 
        android:shape="rectangle" 
        android:angle="90"
        android:color="#FFFFFF"> 

       < corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" 
        android:topLeftRadius="7dp" android:topRightRadius="7dp"
        android:color="#FFFFFF"/> 
    </shape> 
</item>
</selector>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜