setMinimumTrackImage(_:for:)
Assigns a minimum track image to the specified control states.
Declaration
func setMinimumTrackImage(_ image: UIImage?, for state: UIControl.State)Parameters
- image:
The minimum 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 minimum track image, the image width changes 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 minimum track image, the slider ignores the custom minimum 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.