iOS Developer Library — Pre-Release

Developer

UIKit User Interface Catalog

PDF

Segmented Control

Segmented Control Attributes Inspector Reference

image: ../Art/uisegmentedcontrol_attributes_inspector.pdf

Appearance and Behavior

This group specifies the appearance and behavior for the segmented control.

image: ../Art/uisegmentedcontrol_attributes_inspector_group-appearance_and_behavior.png

Style

The basic appearance of the segmented control.

Tint

The color of the segmented control.

tintColor

Segments

The number of segments in the segmented control.

Access: numberOfSegments.

State

Momentary

Whether the segmented control segments are only momentarily selected.

A segmented control selection behavior can be normal or momentary.

  • Normal selection. When the user taps a segment, the segment becomes selected (the segmented control selectedSegmentIndex is set to that segment’s index).

  • Momentary selection. When the user taps a segment, the segment does not become selected, but the segment appears selected while the user holds it.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

momentary

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

momentary

YES

Segment Appearance and Behavior

This group specifies the appearance and behavior for each of the segmented control segments.

image: ../Art/uisegmentedcontrol_attributes_inspector_group-segment_appearance_and_behavior.png

Segment

The segment to configure.

Choose a segment, and then configure the properties in this group.

Title

The title of the segment identified by Segment.

Access: setTitle:forSegmentAtIndex:.

Image

The image of the segment identified by Segment.

Access: setImage:forSegmentAtIndex:.

Content Offset

The offset from the segment origin at which to draw the content of the segment identified by Segment.

Access: setContentOffset:forSegmentAtIndex:.

Behavior

Enabled

Whether segment identified by Segment is enabled.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

setEnabled:forSegmentAtIndex:

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

setEnabled:forSegmentAtIndex:

YES

Selected

Whether segment identified by Segment is selected.

Use selectedSegmentIndex to select a segment.

Selection

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

image: ../Art/user_interface_checkbox-selected.pdf Selected