So I have a .png
that\'s 428x176 px:
I want to use it as a tab bar background image for when an item is in the selected state. The problem is t
Try resizing the image
to the tab bar size. Or Add an imageView
to the tabBar
as subview
, and then use the image in that imageView
.
Subclass the TabBarController
and add imageview
there:
class YourTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
let backgroundImage = UIImageView(image: UIImage(named: "gray background"))
backgroundImage.frame = backgroundImage.bounds
self.view.addSubview(backgroundImage)
}