iOS 7 上未显示 UITabBar 背景图像
UITabBar backgroundImage not showing on iOS 7
我正在这样设置 UITabBar backgroundImage
:
[self.tabBarController.tabBar setBackgroundImage:[UIImage imageNamed:@"ic_tab_bar"]];
[self.tabBarController.tabBar setTranslucent:NO];
它在 iOS 8 上有效,但在 iOS 7 上它什么都不做。
这样试试也许能帮到你
[[UITabBar appearance] setBackgroundImage[UIImage imageNamed:@"ic_tab_bar"];
我终于知道是怎么回事了。我只有 ic_tab_bar@3x.png
资产作为背景图片,出于某种原因它没有缩小比例,所以我添加了 1x 和 2x 资产,它开始显示出来。我希望这对某人有所帮助。
我正在这样设置 UITabBar backgroundImage
:
[self.tabBarController.tabBar setBackgroundImage:[UIImage imageNamed:@"ic_tab_bar"]];
[self.tabBarController.tabBar setTranslucent:NO];
它在 iOS 8 上有效,但在 iOS 7 上它什么都不做。
这样试试也许能帮到你
[[UITabBar appearance] setBackgroundImage[UIImage imageNamed:@"ic_tab_bar"];
我终于知道是怎么回事了。我只有 ic_tab_bar@3x.png
资产作为背景图片,出于某种原因它没有缩小比例,所以我添加了 1x 和 2x 资产,它开始显示出来。我希望这对某人有所帮助。