我最近将我的TabBar图像更改为我自己制作的栏(请参阅照片以供参考)。当我在Iphone 5s模拟器中运行它时,它的尺寸非常合适。但是当我在Iphone 6上运行它时,它不会自动调整大小,所以它停在Iphone 5停止的地方(图2)。如何让TabBar图像调整大小?
更新
override func viewDidLoad() {
super.viewDidLoad()
UITabBar.appearance().translucent = true
UITabBar.appearance().tintColor = UIColor.whiteColor()
UITabBar.appearance().selectionIndicatorImage = UIImage().makeImageWithColorAndSize(UIColor(red: 127.0 / 255.0, green: 217.0 / 255.0, blue: 255.0 / 255.0, alpha: 1.0), size: CGSizeMake(tabBar.frame.width/5, tabBar.frame.height))
UITabBar.appearance().barTintColor = UIColor.whiteColor()
UITabBar.appearance().backgroundImage = UIImage(named:"officialbar")
}