In android the Toggle buttons
are looks like below -
Can we modify this as Iphone
style like below -
And, Can we include the iphone functionality of toggle button like drag to toggle feature also.
How to complete this action? Thanks in Advance.
More info on this link: http://www.mokasocial.com/2011/07/sexily-styled-toggle-buttons-for-android/
and the drawable will be something like:
Use of below code from Android-Switch-Demo example. I can get desired output.
Screenshot of the Application -
If you want to do with shapes (without using images) try this. Currently im using it in a custom checkbox
checkbox_selector.xml
toggle_button_off.xml
toggle_button_on.xml
toggle_background_off.xml
toggle_background_on.xml
white_toggle_icon.xml
take all the images of off and on button and make a layout in relative layout like this
then in code when on is pressed make the background resource as off