user717452
user717452

Reputation: 111

Status Bar Issue on iOS 7

I have noticed a few problems with the status bar when upgrading my apps to iOS 7 as the base SDK. Basically, the Navigation Bar in my Tab Bar Controller seems to be far too close to the status bar. Any ways to remedy this and make it look better?enter image description here

Upvotes: 2

Views: 185

Answers (3)

gabriellanata
gabriellanata

Reputation: 4336

I ran into the problem myself, there are two options:

  1. Add a UINavigationController between your UTabBarController and the UIViewController. This is the best approach even if you do not plan on pushing view controllers, as a bonus it is easier to add this functionality later. It will be natively supported on all iOS versions without any extra code.

  2. In Interfaceb builder put the UINavigationBar below the status bar. To do this with AutoLayout add a fixed vertical space of '0' from the navigation bar to the "Top Layout Guide" and add the following code in your veiwDidLoad method:

    if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
    

Hope this helps

Upvotes: 0

Sabareesh
Sabareesh

Reputation: 3605

check with below code.

if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
 {
    [self setEdgesForExtendedLayout:UIRectEdgeLeft | UIRectEdgeRight];
 }

Upvotes: 1

Divya Bhaloidiya
Divya Bhaloidiya

Reputation: 5064

Add following code in your veiwDidLoad method :

if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {

    self.edgesForExtendedLayout = UIRectEdgeNone;

}

Upvotes: 1

Related Questions