Contents

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 leftState and rightState are both normal

  • Between a selected segment on the left and an unselected on the right, where leftState is selected and rightState is normal

  • Between an unselected segment on the left and a selected on the right, where leftState is normal and rightState is selected

See Also

Customizing appearance