Demonstrates how to use a Switch element.
The appearance of a Switch control varies by platform:
- On Android, a Switch object can be styled either as a checkbox or toggle button using the Ti.UI.Android.SWITCH_STYLE_CHECKBOX property, as shown below. The checkbox style can optionally display a label next to the control.
- On iOS, a Switch appears as an iOS on/off switch and doesn't have any text associated with it.
The following screenshots show the sample app running on Android and iOS.
index.xml view displays a default Switch control that appears on all platforms, a titled switch that appears on Android and mobile web, and a checkbox style switch that only appears on Android.
- Titanium.UI.Switch API reference