You can add a basic toggle button to your layout with theToggleButton
object. Android 4.0 (API level 14) introduces another kind of toggle button called a switch that provides a slider control, which you can add with a Switch
object.
![](http://developer.android.com/images/ui/togglebutton.png)
Toggle buttons
![](http://developer.android.com/images/ui/switch.png)
Switches (in Android 4.0+)
SwitchButton,开关按钮,可自定义。