iOS Guides | Samples

MonoTouch.UIKit.UISegmentedControl Class

A UIControl that displays multiple buttons horizontally.

See Also: UISegmentedControl

Syntax

[MonoTouch.Foundation.Register("UISegmentedControl", true)]
public class UISegmentedControl : UIControl

Related content

Requirements

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

The members of MonoTouch.UIKit.UISegmentedControl 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 UISegmentedControl with the specified frame.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.
Creates a UISegmentedControl by passing an array containing strings or UIImage objects.

Public Properties

[read-only]
static
AppearanceUISegmentedControl+UISegmentedControlAppearance. Strongly-typed property that returns the UIAppearance class for this class.
ApportionsSegmentWidthsByContentBoolean. Allow the segment control to adjust the width of each segment based upon each content width.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
ControlStyleUISegmentedControlStyle. The style of the segmented control.
MomentaryBoolean. Determines if segments show the selected state.
[read-only]
NumberOfSegmentsInt32. Returns the number of segments in the segmented control.
SelectedSegmentInt32. The index of the selected segment.

Public Methods

static
AppearanceWhenContainedIn(params Type[]) : UISegmentedControl+UISegmentedControlAppearance
Returns a strongly typed UIAppearance for instances of this class when the view is hosted in the specified hierarchy.
ContentPositionAdjustment(UISegmentedControlSegment, UIBarMetrics) : UIOffset
Returns the offset for the content of a given segment for the specified bar metrics.
DividerImageForLeftSegmentStaterightSegmentStatebarMetrics(UIControlState, UIControlState, UIBarMetrics) : UIImage
Retrieves the divider image between the segments.
static
GetAppearance(UITraitCollection) : UISegmentedControl+UISegmentedControlAppearance
Returns an appearance proxy for the specified traits.
static
GetAppearance(UITraitCollection, params Type[]) : UISegmentedControl+UISegmentedControlAppearance
Returns an appearance proxy for the specified traits when found in the conatiners containment hierarchy.
static
GetAppearance<T>() : UISegmentedControl+UISegmentedControlAppearance
Obtains the appearance proxy UISegmentedControlAppearance for the subclass of UISegmentedControl.
static
GetAppearance<T>(UITraitCollection) : UISegmentedControl+UISegmentedControlAppearance
Obtains the appearance proxy UISegmentedControlAppearance for the subclass of UISegmentedControl.
static
GetAppearance<T>(UITraitCollection, params Type[]) : UISegmentedControl+UISegmentedControlAppearance
Obtains the appearance proxy UISegmentedControlAppearance for the subclass of UISegmentedControl that has the specified trait collection when the view is hosted in the specified hierarchy.
GetBackgroundImage(UIControlState, UIBarMetrics) : UIImage
Used to retrieve the background image for the segmented control for a specified control state and bar metrics.
GetContentOffset(Int32) : SizeF
The offset used for drawing content in a specified segment.
GetTitleTextAttributes(UIControlState) : UITextAttributes
Returns the current rendering text attributes for the requested state.
ImageAt(Int32) : UIImage
Retrieves the image used in a particular segment
InsertSegment(UIImage, Int32, Boolean)
Adds a segment to the segmented control.
InsertSegment(String, Int32, Boolean)
Adds a segment to the segmented control.
IsEnabled(Int32) : Boolean
Returns if a particular segment is enabled.
RemoveAllSegments()
Removes all segments
RemoveSegmentAtIndex(Int32, Boolean)
Removes a particular segment from the segmented control.
SegmentWidth(Int32) : Single
Returns the with of a particular segment.
SetBackgroundImage(UIImage, UIControlState, UIBarMetrics)
Set the background image for the segmented control.
SetContentOffset(SizeF, Int32)
Sets the content offset for a specified segment.
SetContentPositionAdjustment(UIOffset, UISegmentedControlSegment, UIBarMetrics)
Sets the offset for the content of a given segment for the specified bar metrics.
SetDividerImage(UIImage, UIControlState, UIControlState, UIBarMetrics)
Sets the divider image for the specified segment states and bar metrics..
SetEnabled(Boolean, Int32)
Enables or disables a given segment.
SetImage(UIImage, Int32)
Set an image for a particular segment.
SetTitle(String, Int32)
Set a title for a particular segment.
SetTitleTextAttributes(UITextAttributes, UIControlState)
Sets the rendering text attributes for a specific state in the control.
SetWidth(Single, Int32)
Sets the width for a particular segment.
TitleAt(Int32) : String
Allows the title for a particular segment to be retrieved.