I have a series of UINavigationControllers
inside a UITabBar
controller. I want to hide the status bar. When I do this however, the navigation bar adjusts itself to become shorter:
Problem Image
How can I prevent this and get something like the picture below?
desired outcome
Currently I am just hiding the status bar using [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
Create a custom UINavigationBar with a custom sizeThatFits.
@implementation UINavigationBar (customNavigationBar)
- (CGSize)sizeThatFits:(CGSize)size {
CGSize newSize = CGSizeMake(self.frame.size.width,64);
return newSize;
}
@end
if any queries comments pls
You could create a Container View inside your Storyboard and set a fixed Top Space (same as status bar). You could embed your NavigationController
in this View then.
Image 1
Image 2
I hope this helps.
Edit: Added Images
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