0

I'm studing android programming to using switch button.

but I can't implement switch button like O,I simbols(you can see android setting screen).

I tried to implement to using these properites (android:thumb, android:track)

but i can't implement simbol(O, I).

Do you have any idea how to do it? I really tried to find the answer but I haven't been successful.

Thank you.

  • It may help you http://stackoverflow.com/questions/10118050/how-can-i-style-an-android-switch – Roman Bugaian Apr 01 '13 at 12:52
  • 1
    Thank you for your help. I already saw the answer. but this answer was explained background and thumb area. I want to modify text area(on/off text) to image(icon). How can i do that? I can modify text but I can't add icon image. – user2231337 Apr 02 '13 at 04:43

1 Answers1

1

You can use the following attributes in your activity_main.xml:

   <Switch
    android:id="@+id/switch1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:checked="true"
    android:textOn="I" 
    android:textOff="O"
    />

hope this will help you..

M.Makki
  • 11
  • 1