Note: if I just set the textColor of the TextViews to a single color I DO NOT have the problem with the background of the TextViews. It is only when I use the ColorStateList xml that this behavior is seen.
On Jan 3, 3:07 pm, "[email protected]" <[email protected]> wrote: > I have a LinearLayout that contains an ImageView and two TextViews > that is returned by my ListView item adapter. I know this has been > asked many times and I am following the advice I have found so far but > have a small yet elusive problem with the color of the TextViews. The > ListView has a selector set to a 9-patch drawable that puts a nice > background behind the list items when selected or pressed. In the xml > for the LinearLayout returned to the ListView I set the > textview.textColor="@color/textview_statelist". > > textview_statelist: > <?xml version="1.0" encoding="utf-8"?> > <selector xmlns:android="http://schemas.android.com/apk/res/android"> > <item android:state_pressed="true" > android:color="@color/white_text" /> > <item android:state_selected="true" > android:color="@color/white_text" /> > <item > android:color="@color/black_text" /> > </selector> > > When I run the app and touch an item in the list everything works > perfect; the text color changes with state just fine. However, after > I touch the item in the list, for a split second, the text views > background becomes an opaque white and NOT the listSelector of the > ListView. After just a second the ListView repaints again and > everything is fine, the TextView again paint with the correct > background (ie, not opaque anymore). > > Has anyone experienced this behavior? If so, has anyone found a > resolution to this? I the only thing I can think of is that I am > missing some item states in the color state list xml, but the fact > that the text color is changing makes think this is NOT true as it is > a problem with the background of the text view and NOT the color of > the text. > > Mark. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

