ios7强制使用半透明的tabbar

时间:2013-11-08 14:23:54

标签: ios6 ios7 interface-builder uitabbar

3.5“ios7:

3.5 ios7

3.5“ios 6:

3.6 ios6

4“ios7:

4 ios7

我想要一个不透明的标签栏,我在任何地方都设置了它:

在标签栏:

tab bar

在导航控制器上: - 取消选中“半透明”

enter image description here

在4“我没有半透明的强制。我怎么能逃脱3.5”,ios7版本?

编辑:

This方法不起作用。

EDIT2:

This解决方案也不起作用。

EDIT3:

Neither this

编辑4: 我认为这是ios中的一个错误,我不知道在哪里挖,因为所做的更改看起来像这样:

3.5“ios 6.1 - 观察上部线被移除:

3.5" ios6.1

4“ios 7: - 观察者上部:完全黑色 - 如同背景图像的底部部分。

40 ios7

3.5“ios 7仍然相同!该怎么办?:(

在.plist中有一个“Nib文件基名:MainVindow。 我已经设置了TabBarController并链接到AppDelegate。在didFinishLaunchingWithOptions,我正在进行此设置。也许其他地方应该是?

 if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")){
        [self.tabBarController.tabBar setClipsToBounds:YES];

        UIImage* tabBarBackground = [UIImage imageNamed:@"transparentImage.png"];
        [[UITabBar appearance] setShadowImage:tabBarBackground];
        [[UITabBar appearance] setBackgroundImage:tabBarBackground];

        UITabBar *tabBar = self.tabBarController.tabBar;
        tabBar.tintColor  = [UIColor yellowColor];
        tabBar.barStyle = UIBarStyleBlack;
    }


    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];
  • 如果我将代码移至applicationDidBecomeActive
  • ,则无效

1 个答案:

答案 0 :(得分:1)

尝试设置背景图片。它对我有用。

UITabBar *tabBar = [UITabBar appearance];
[tabBar setBackgroundImage:[UIImage imageNamed:@"tabbar-background"]];