On Monday, December 20, 2010 11:57:22 AM UTC+6, Derek Winstead wrote:
>
> I've already done this before in my app (layout with textviews and the 
> layout has the onclicks), however I do have a new question. Adding the 
> statelist as the background works for the layout but what about the 
> text changing colors? 
>
>
For the TextView inside layout:
android:focusable="true" android:duplicateParentState="true"

focusable will enable it to have different states (focused, not focussed 
etc, which a TextView does not have by default).
duplicateParentState will make its state to be same as its parent (the 
layout which contains the TextView)

So, when the state of the parent layout changes, the state of the TextView 
changes. So, text color changes also.

If you do not like the default text colors provided by Android for different 
states, you can further use your own Color State list for the TextView to 
specify your own colors.
http://developer.android.com/guide/topics/resources/color-list-resource.html

Regards
Sarwar Erfan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to