---
title: "backgroundImage(for:style:barMetrics:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uibarbuttonitem/backgroundimage(for:style:barmetrics:)"
---

# backgroundImage(for:style:barMetrics:)

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

## Declaration

```swift
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

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

## See Also

### Customizing the background

- [backgroundVerticalPositionAdjustment(for:)](uikit/uibarbuttonitem/backgroundverticalpositionadjustment(for:).md)
- [setBackgroundVerticalPositionAdjustment(_:for:)](uikit/uibarbuttonitem/setbackgroundverticalpositionadjustment(_:for:).md)
- [backgroundImage(for:barMetrics:)](uikit/uibarbuttonitem/backgroundimage(for:barmetrics:).md)
- [setBackgroundImage(_:for:barMetrics:)](uikit/uibarbuttonitem/setbackgroundimage(_:for:barmetrics:).md)
- [setBackgroundImage(_:for:style:barMetrics:)](uikit/uibarbuttonitem/setbackgroundimage(_:for:style:barmetrics:).md)
