Reputation: 111
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?
Upvotes: 2
Views: 185
Reputation: 4336
I ran into the problem myself, there are two options:
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.
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
Reputation: 3605
check with below code.
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
{
[self setEdgesForExtendedLayout:UIRectEdgeLeft | UIRectEdgeRight];
}
Upvotes: 1
Reputation: 5064
Add following code in your veiwDidLoad method :
if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) {
self.edgesForExtendedLayout = UIRectEdgeNone;
}
Upvotes: 1