See Also: Switch
public class Switch : CompoundButton
A Switch is a two-state toggle switch widget that can select between two options. The user may drag the "thumb" back and forth to choose the selected option, or simply tap to toggle as if it were a checkbox. The TextView.TextFormatted property controls the text displayed in the label for the switch, whereas the Switch.TextOffFormatted and Switch.TextOnFormatted text controls the text on the thumb. Similarly, the TextView.SetTextAppearance(Context,Int32) and the related setTypeface() methods control the typeface and style of label text, whereas the Switch.SetSwitchTextAppearance(Context,Int32) and the related setSwitchTypeface() methods control that of the thumb.
See the Toggle Buttons guide.
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14
The members of Android.Widget.Switch are listed below.
See Also: CompoundButton
|Construct a new Switch with default styling.|
|Construct a new Switch with default styling, overriding specific style attributes as requested.|
|Construct a new Switch with a default style determined by the given theme attribute, overriding specific style attributes as requested.|
|Construct a new Switch with a default style determined by the given theme attribute or style resource, overriding specific style attributes as requested.|
|SplitTrack||Boolean. Returns whether the track should be split by the thumb.|
|SwitchMinWidth||Int32. Get the minimum width of the switch in pixels.|
|SwitchPadding||Int32. Get the amount of horizontal padding between the switch and the associated text.|
|TextOffFormatted||ICharSequence. Returns the text displayed when the button is not in the checked state.|
|TextOnFormatted||ICharSequence. Returns the text displayed when the button is in the checked state.|
|ThumbDrawable||Drawable. Get the drawable used for the switch "thumb" - the piece that the user can physically touch and drag along the track.|
|ThumbTextPadding||Int32. Get the horizontal padding around the text drawn on the switch itself.|
|TrackDrawable||Drawable. Get the drawable used for the track that the switch slides within.|
Sets the switch text color, size, style, hint color, and highlight color from the specified TextAppearance resource.
Sets the typeface in which the text should be displayed on the switch.
Sets the typeface and style in which the text should be displayed on the switch, and turns on the fake bold and italic bits in the Paint if the Typeface that you provided does not have all the bits in the style that you specified.
Set the drawable used for the switch "thumb" - the piece that the user can physically touch and drag along the track.
Set the drawable used for the track that the switch slides within.