View is not adjusting itself after hiding Tabbar
I have a UITabbar having 5 tabs like this
Now I want to hide the UITabbar when taps on the Feed Tab. I want to show the full screen there. 开发者_如何学CI am able to hide the tabbar but the UIView of Feed screen is not adjusting itself and I can see the white space at the place of UITabBar. I set the frame of view after hiding the UITabbar but it is also not working. How can I get the object of UITabbarController in the UIViewController classes which are added on the UITabbar so that I can call the delegate methods of UITabbarController. For instance, how can I have the object of UITabbarController in Feed Class.Please Help! If I am not clear please let me know. Thanks-
Adding to Ariel answer, you need to set "hidesBottomBarWhenPushed" property to YES,when you are loading it from the nib. As " initWithCoder"-Method is called if you are loading from the nib, you need to set that property there only. Hope this will help you out.
Try to add self.hidesBottomBarWhenPushed = YES;
inside of -(id)initWithCoder:(NSCoder *)aDecoder;
of the Feed class implementation like so:
-(id)initWithCoder:(NSCoder *)aDecoder{
self = [super initWithCoder:aDecoder];
if(self){
self.hidesBottomBarWhenPushed = YES;
//more of your initialization code...
}
return self;
}
It should be in -(id)initWithCoder:(NSCoder *)aDecoder;
and not -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
as your view is loaded from the .xib file by the application.
Try to set self.navigationController.view.frame size when you hide the tabbar.
You can get the fullscreen size with [[UIScreen mainScreen] bounds].
精彩评论