setDividerImage(_:forLeftSegmentState:rightSegmentState:barMetrics:)
Sets the divider image to use for a given combination of left and right segment states and bar metrics.
Declaration
func setDividerImage(_ dividerImage: UIImage?, forLeftSegmentState leftState: UIControl.State, rightSegmentState rightState: UIControl.State, barMetrics: UIBarMetrics)Parameters
- dividerImage:
The divider image to use.
- leftState:
The state of the left segment.
- rightState:
The state of the right segment.
- barMetrics:
Bar metrics.
Discussion
To customize the segmented control appearance, provide divider images for the following cases:
Between two unselected segments, where
leftStateandrightStateare both normalBetween a selected segment on the left and an unselected on the right, where
leftStateis selected andrightStateis normalBetween an unselected segment on the left and a selected on the right, where
leftStateis normal andrightStateis selected
See Also
Customizing appearance
selectedSegmentTintColorbackgroundImage(for:barMetrics:)setBackgroundImage(_:for:barMetrics:)contentPositionAdjustment(forSegmentType:barMetrics:)setContentPositionAdjustment(_:forSegmentType:barMetrics:)UISegmentedControl.SegmentdividerImage(forLeftSegmentState:rightSegmentState:barMetrics:)titleTextAttributes(for:)setTitleTextAttributes(_:for:)