setBackgroundImage(_:for:barMetrics:)
Sets the background image for a specified state and bar metrics.
Declaration
func setBackgroundImage(_ backgroundImage: UIImage?, for state: UIControl.State, barMetrics: UIBarMetrics)Parameters
- backgroundImage:
The background image for the specified state and metrics.
- state:
A control state.
- barMetrics:
Bar metrics.
Discussion
For good results, backgroundImage must be a stretchable image.