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

# setBackgroundImage(_:for:)

Sets the background image for the control when it’s in the specified state.

```
func setBackgroundImage(_ image: UIImage?, for state: UIControl.State)
```

## Parameters

`image`

The background image to use for the specified state.

`state`

The control state in which you want to display the image.

## Discussion

For good results, `image` must be a stretchable image.

---

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)