Android selector & text color

I want a simple TextView to behave the way simple_list_item_1 in a ListView does. Here’s the XML: <TextView xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_height=”wrap_content” android:layout_width=”fill_parent” android:gravity=”center” android:focusable=”true” android:minHeight=”?android:attr/listPreferredItemHeight” android:textAppearance=”?android:attr/textAppearanceLarge” android:background=”@android:drawable/list_selector_background” /> Everything works except for the text color that (expectedly) doesn’t change in focused state. How do I make it change to textAppearanceLargeInverse? 9 Answers 9

Android customized button; changing text color

I made a button that changes the background drawable on different states, this way: <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_pressed=”true” android:drawable=”@drawable/btn_location_pressed” /> <!– pressed –> <item android:state_focused=”true” android:drawable=”@drawable/btn_location_pressed”/> <!– focused –> <item android:drawable=”@drawable/btn_location”/> <!– default –> </selector> The problem here is that I’m also trying to change the textColor as I do with the drawable but I’m … Read more