Slide Toggle for Android
iOS does not seem to have a "slide toggle", at least under that name, based on a Google search. And, you did not provide an image (or a link to an image) of what you want.
Android 4.0 added a Switch
that you might be able to backport to earlier versions. You will see samples of it in the API Demos app on your emulator:
Android: How to create slide (on/off) button
Well it seems that Switch component is the best solution if your target SDK is higher than 4.0 (Ice Cream Sandwich). So for the others who will face the same problem look at it. :)
Create an toggle / sliding button
Follow the three steps and after it all your app's togglebutton got the new style!
toggle.xml: (drawable-folder)
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/toggle_off" />
<item android:state_checked="true" android:drawable="@drawable/toggle_on" />
</selector>
styles.xml: (values-folder)
<style name="toggle" parent="@android:style/Widget.Button.Toggle">
<item name="android:background">@drawable/toggle</item>
<item name="android:textOn"> </item>
<item name="android:textOff"> </item>
</style>
and last step you have to teach the current AppTheme that you have a custom toggle-button:
<style name="AppTheme" parent="android:Theme.Holo.Light">
<item name="android:buttonStyleToggle">@style/toggle</item>
</style>
Toggle button slider with multi state. Left and Right
Solved it using customized seekbar.
Use Android 4.0 styled toggle-button
New Edit: I now did a full backport of the Switch back to API Level 8 and put in on github:
https://github.com/ankri/SwitchCompatLibrary
The old post with my custom implementation of the Switch:
I'm a bit late to the party but I had the same problem. I took the source code from the other post in this thred and made my own version of the switch.
You can find the source code and documentation on my website
This is what it looks like:
edit: Updated link and picture
Related Topics
How to Get the Current Dns Servers for Android
Android Studio: Default Project Directory
Strange Behavior of Android Videoview - "Can't Play Video"
Set Build Path in Eclipse for Ndk Program
Why Is Calling Process.Killprocess(Process.Mypid()) a Bad Idea
Android Studio 1.0.2 Not Building App:Mergedebugresources Error
Listening to Scroll Events Horizontalscrollview Android
Developing Two Android Apps and Communicating Between Two
How to Change the Proguard Mapping File Name in Gradle for Android Project
How to Download a PDF File in Android
Delete File from Internal Storage
Start New Activity and Finish Current One in Android
Can Gradientcolor Be Used to Define a Gradient for a Fill or Stroke Entirely in Xml
Updated Sdk Version, Getting Classnotfoundexception: Android.Support.V4.View.Viewpager
Size of Android Notification Bar and Title Bar
Given a Tensor Flow Model Graph, How to Find the Input Node and Output Node Names
How to Check If Music Is Playing by Using a Broadcast Receiver