My app is a UITabBarController based app with 3 children vc. The status bar is overlapping with my viewcontrollers. I have tried everything I have found in SO:
I tried adding this to my AppDelegate:
//Offset downwards to make room for status bar self.window.bounds = CGRectMake(0, -20, self.window.frame.size.width, self.window.frame.size.height);
It worked because it moved the entire UITabBarController down by 20. But this resulted in the tabs being cut off at the bottom by -20.
So Im thinking i just want to apply the effect to the UIViewControllers in each tab since there is not much to cut off at the bottom.
So I tried adding similar code to the viewDidLoad and calling setNeedsDisplay afterwards:
self.view.bounds = CGRectMake(0, -20, self.view.frame.size.width, self.view.frame.size.height);
But this has no effect at all, still get overlapping.
I tried adding this to viewDidLoad
self.edgesForExtendedLayout = UIRectEdgeNone;
and I also unchecked the Extend Edges Under Top Bars but it still runs into the status bar. Also tried:
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
{
self.edgesForExtendedLayout = UIRectEdgeNone;
}
but no cigar.
I dont have the deltas because im using AL.
I dont want to HIDE my status bar because it displays open/close times so the user would find it handy to be able to see the time.
Im thinking shifting the view down a bit in each viewcontroller that needs it is the best option, but why didnt my code work for #2?
(btw:not sure why code format isnt working and the numbering is off, even when i try to edit it, it seems to be working fine in the edit view but not in the pre-view or live-view)
for iOS 7 and xcode 5 to avoid overlapping
use in
viewDidLoad method
self.edgesForExtendedLayout = UIRectEdgeNone;
self.automaticallyAdjustsScrollViewInsets = NO;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With