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

# backgroundImage(for:style:barMetrics:)

Returns the background image for the specified state, style, and metrics.

```
func backgroundImage(for state: UIControl.State, style: UIBarButtonItem.Style, barMetrics: UIBarMetrics) -> UIImage?
```

## Parameters

`state`

The bar button state.

`style`

The bar button style.

`barMetrics`

The bar button metrics.

## Return Value

The background image associated with the specified state, style, and metrics.

## Discussion

---

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)