iOS Guides | Samples

MonoTouch.UIKit.UISwitch Class

A UIControl that displays an on/off switch.

See Also: UISwitch

Syntax

[MonoTouch.Foundation.Register("UISwitch", true)]
[MonoTouch.ObjCRuntime.Unavailable(MonoTouch.ObjCRuntime.PlatformName.TvOS, MonoTouch.ObjCRuntime.PlatformArchitecture.All, null)]
public class UISwitch : UIControl, IDisposable

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.UIKit.UISwitch are listed below.

See Also: UIControl

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
Initializes the UISwitch with the specified frame.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

[read-only]
static
AppearanceUISwitch+UISwitchAppearance. Strongly-typed property that returns the UIAppearance class for this class.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
OffImageUIImage. The image to be used to indicate Off.
OnBoolean. This property returns if the state of the switch is on or off.
OnImageUIImage. The UIImage representing the On state.
OnTintColorUIColor. The tint color to use when the switch is turned on.
ThumbTintColorUIColor. The color used to tint the thumb.

Public Methods

static
AppearanceWhenContainedIn(params Type[]) : UISwitch+UISwitchAppearance
Returns a strongly typed UIAppearance for instances of this class when the view is hosted in the specified hierarchy.
static
GetAppearance(UITraitCollection) : UISwitch+UISwitchAppearance
Returns an appearance proxy for the specified traits.
static
GetAppearance(UITraitCollection, params Type[]) : UISwitch+UISwitchAppearance
Returns an appearance proxy for the specified traits when found in the containers containment hierarchy.
static
GetAppearance<T>() : UISwitch+UISwitchAppearance
Obtains the appearance proxy UISwitchAppearance for the subclass of UISwitch.
static
GetAppearance<T>(UITraitCollection) : UISwitch+UISwitchAppearance
Obtains the appearance proxy UISwitchAppearance for the subclass of UISwitch.
static
GetAppearance<T>(UITraitCollection, params Type[]) : UISwitch+UISwitchAppearance
Obtains the appearance proxy UISwitchAppearance for the subclass of UISwitch that has the specified trait collection when the view is hosted in the specified hierarchy.
SetState(Boolean, Boolean)
This method changes the state of the switch, and will animate the change if specified.