setMaximumTrackImage(_:for:)
Assigns a maximum track image to the specified control states.
Declaration
func setMaximumTrackImage(_ image: UIImage?, for state: UIControl.State)Parameters
- image:
The maximum track image to associate with the specified states.
- state:
The control state with which to associate the image.
Discussion
Because the movement of the slider’s thumb changes the width of the area occupied by the maximum track image, the image width must change accordingly. To accommodate this requirement, specify track images as stretchable images that can grow or shrink to fill the available space. For information about how to create stretchable images, see UIImage.
When you specify a custom maximum track image, the slider ignores the custom maximum track tint color, if any.
Sliders respond to user interaction with dynamic effects and appearance. If you use images to customize the appearance of the track, then the slider doesn’t apply the dynamic effects or alter the appearance.