---
title: "setScopeBarButtonBackgroundImage(_:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisearchbar/setscopebarbuttonbackgroundimage(_:for:)"
---

# setScopeBarButtonBackgroundImage(_:for:)

Sets the background image for the scope bar button in a given state.

## Declaration

```swift
func setScopeBarButtonBackgroundImage(_ backgroundImage: UIImage?, for state: UIControl.State)
```

## Parameters

- `backgroundImage`: The background image for the scope bar button in state.
- `state`: A control state.

## Discussion

Discussion For more details, see scopeBarButtonBackgroundImage(for:).

## See Also

### Customizing the scope bar appearance

- [scopeBarBackgroundImage](uikit/uisearchbar/scopebarbackgroundimage.md)
- [scopeBarButtonBackgroundImage(for:)](uikit/uisearchbar/scopebarbuttonbackgroundimage(for:).md)
- [scopeBarButtonDividerImage(forLeftSegmentState:rightSegmentState:)](uikit/uisearchbar/scopebarbuttondividerimage(forleftsegmentstate:rightsegmentstate:).md)
- [setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)](uikit/uisearchbar/setscopebarbuttondividerimage(_:forleftsegmentstate:rightsegmentstate:).md)
- [scopeBarButtonTitleTextAttributes(for:)](uikit/uisearchbar/scopebarbuttontitletextattributes(for:).md)
- [setScopeBarButtonTitleTextAttributes(_:for:)](uikit/uisearchbar/setscopebarbuttontitletextattributes(_:for:).md)
