ListView选择器和形状:如何设置文本颜色?

时间:2014-08-16 14:50:55

标签: android listview shape textcolor

我有一个ListView作为我的应用程序的slidemenu。

<ListView
    android:id="@+id/list_slidermenu"
    android:listSelector="@drawable/list_selector" />
drawable中的

list_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:drawable="@drawable/list_item_bg_normal" android:state_activated="false"/>
    <item android:drawable="@drawable/list_item_bg_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/list_item_bg_pressed" android:state_activated="true"/>

</selector>

list_item_bg_normal.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <gradient
        android:angle="90"
        android:endColor="@color/white"
        android:startColor="@color/white" />

</shape>

我尝试添加android:colorandroid:textColor属性,但似乎没有任何效果。该怎么办?谢谢你的帮助。

0 个答案:

没有答案