Instance Method

widthForSegmentAtIndex:

Returns the width of the indicated segment of the receiver.

Declaration

- (CGFloat)widthForSegmentAtIndex:(NSUInteger)segment;

Parameters

segment

An index number identifying a segment in the control. It must be a number between 0 and the number of segments (numberOfSegments) minus 1; values exceeding this upper range are pinned to it.

Return Value

A float value specifying the width of the segment. If the value is {0.0}, UISegmentedControl automatically sizes the segment.

See Also

Managing Segment Behavior and Appearance

momentary

A Boolean value that determines whether segments in the receiver show selected state.

segmentedControlStyle

The style of the segmented control.

Deprecated
- setEnabled:forSegmentAtIndex:

Enables the specified segment.

- isEnabledForSegmentAtIndex:

Returns whether the indicated segment is enabled.

- setContentOffset:forSegmentAtIndex:

Adjusts the offset for drawing the content (image or text) of the specified segment.

- contentOffsetForSegmentAtIndex:

Returns the offset for drawing the content (image or text) of the specified segment.

- setWidth:forSegmentAtIndex:

Sets the width of the specified segment of the receiver.

apportionsSegmentWidthsByContent

Indicates whether the control attempts to adjust segment widths based on their content widths.