I have a scenario in my android app where I need to design a switch similar to the switch used to in WIFI,Bluetooth in Android device's setting screen. I am unable to change the background color of switch text. Can anyone help me in sorting out this issue.
Asked
Active
Viewed 85 times
2 Answers
1
Janusz has explained styling of switches perfectly with details in the link below:
-
So, is there no possibility where we can do it through programmatically rather than this selector approach whcih is static. – user1276092 Mar 26 '14 at 15:17
0
Try searching first before posting questions
You can set the drawables inside the selector of your toggle button
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_checked="false"
android:drawable="@drawable/ic_slide_switch_off" />
<item
android:state_checked="true"
android:drawable="@drawable/ic_slide_switch_on" />
</selector>
Community
- 1
- 1
Saket Joshi
- 101
- 3