0

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.

user1276092
  • 523
  • 3
  • 8
  • 30

2 Answers2

1

Janusz has explained styling of switches perfectly with details in the link below:

How can I style an Android Switch?

Community
  • 1
  • 1
canova
  • 3,965
  • 2
  • 22
  • 39
  • 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

Possible duplicate

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