简体   繁体   中英

Black bar shown when UITabBar is hidden on iPhone

I'm purposefully hiding my tab-bar upon viewing a controller consisting of a UIWebView :

- (void)viewWillAppear:(BOOL)animated{
    self.hidesBottomBarWhenPushed = YES;
    self.tabBarController.tabBar.hidden = YES;

    self.url = [NSURL URLWithString:self.urlString];
}

In my storyboard, for this controller, I've set the bottom bar to be "None":

在此处输入图片说明

My storyboard shows that the web-view is now taking up all available space at the bottom:

在此处输入图片说明

However, I know have a black bar where my tab bar used to be:

在此处输入图片说明

Does anyone know why??

Setting hidesBottomBarWhenPushed to YES in viewWillAppear doesn't do anything.

Set hidesBottomBarWhenPushed to YES before you push to this view controller.

MyViewController *myController = [[MyViewController alloc] init];
//hide tabbar
myController.hidesBottomBarWhenPushed = YES;
//add it to stack.
[[self navigationController] pushViewController:myController animated:YES];

Or in storyboard like this

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM