tags:

views:

369

answers:

1

I m new to Android, I m creating simple application in Android and i want to change the focus color.That my application consist of two text box .when moving focus to the textbox,i can get the focus of textbox with the orange color..is it possible to change the color..if is it possible pls tell me how to do it..

regards, s.kumaran.

+1  A: 

Yes, you can change the focus color of a button (this an open source OS). I poked around the SDK and could not find a direct way to change the focus color of a button. I did find this tantalizing xml file...

widget_button.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    <item android:state_focused="true" android:color="#ff000000"/>
    <item android:color="#ff000000"/> <!-- unfocused -->
</selector>

...but I'm having a hard time figuring out where to adjust things. Button extends TextView, and based on the TextView source that's where the focus color is defined.

If you really want to this you need to make your own class from source.

PS: Since this is so hard I suspect it's discouraged by the Andoird team. It makes for a less consistent user interface.

Will
If anybody has a better method than above I'd love to see it!
Will