<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISlider/setMinimumTrackImage(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISlider(im)setMinimumTrackImage:forState:"
  },
  "title" : "setMinimumTrackImage(_:for:)"
}
-->

# setMinimumTrackImage(_:for:)

Assigns a minimum track image to the specified control states.

```
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`](/documentation/UIKit/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.

> Important:
> This method isn’t available when the user interface idiom is ``doc://com.apple.uikit/documentation/UIKit/UIUserInterfaceIdiom/mac`` and ``doc://com.apple.uikit/documentation/UIKit/UISlider/behavioralStyle`` is ``doc://com.apple.uikit/documentation/UIKit/UIBehavioralStyle/mac`` — calling it while in this state throws an exception.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)