Yes, maybe you need to define your own style for the switches, in res / values /styles.xml:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="CustomTheme" parent="android:Theme"> <item name="android:radioButtonStyle">@style/RadioButton</item> </style> <style name="RadioButton" parent="@android:style/Widget.CompoundButton.RadioButton"> <item name="android:button">@drawable/radio</item> </style> </resources>
'radio' here should be an invoice with an excerpt, radio.xml:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:state_window_focused="false" android:drawable="@drawable/radio_hover" /> <item android:state_checked="false" android:state_window_focused="false" android:drawable="@drawable/radio_normal" /> <item android:state_checked="true" android:state_pressed="true" android:drawable="@drawable/radio_active" /> <item android:state_checked="false" android:state_pressed="true" android:drawable="@drawable/radio_active" /> <item android:state_checked="true" android:state_focused="true" android:drawable="@drawable/radio_hover" /> <item android:state_checked="false" android:state_focused="true" android:drawable="@drawable/radio_normal_off" /> <item android:state_checked="false" android:drawable="@drawable/radio_normal" /> <item android:state_checked="true" android:drawable="@drawable/radio_hover" /> </selector>
Then apply the special theme to either the whole application or the actions of your choice.
For more information on themes and styles, see http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/ , which is a good guide.
Konstantin Burov Aug 26 '10 at 15:37 2010-08-26 15:37
source share