Search code examples
ios6ios7interface-builderuitabbar

ios7 forced translucient tabbar


3.5" ios7:

3.5 ios7

3.5" ios 6:

3.6 ios6

4" ios7:

4 ios7

I want an Opaque tab bar and I have set it everywhere I think:

At tab bar:

tab bar

At Navigation controllers: - unchecked the translucient

enter image description here

In 4" I don't have the translucent forced. how can I escape at 3.5" , ios7 version?

Edit:

This method doesn't work.

Edit2:

This solution doesn't work either.

Edit3:

Neither this

Edit 4: I think this is a bug in ios, I don't know where to dig anymore, because the changes made looks like this:

3.5" ios 6.1 - observe the upper part line removed:

3.5" ios6.1

4" ios 7: - observer the upper part: completely black - as how it is the background image bottom part.

40 ios7

The 3.5" ios 7 still the same! What to do? :(

At .plist there is a "Nib file base name: MainVindow. And there I have set the TabBarController and is linked to AppDelegate. At didFinishLaunchingWithOptions I am doing this settings. Maybe elsewhere should be?

 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];
  • no effect if I move the code to: applicationDidBecomeActive

Solution

  • Try to set background image. It worked for me.

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