简体   繁体   中英

Bottom toolbar shows in iPhone but not iPad

My app is embeded in a naviguation controller, I dragged a Empty viewController then added a tool bar at the bottom.

It shows in my storyboard, but when I run on a device/simulator it does not show in the iPad.

I did the same thing on iPhone and it shows.

How do I solve this?

Here's the code that loads:

- (void)viewDidLoad{
    [super viewDidLoad];
// Do any additional setup after loading the view.
   [self.navigationItem setHidesBackButton:YES animated:YES];
    self.hidesBottomBarWhenPushed = YES ;

}

这是我故事板上的iPad

I know it's strange to have self.hidesBottomBarWhenPushed = YES ; but my understanding is that the navigation controller has its own bottom bar. And the same code works fine on iPhone. So im not sure why I still get an issue.

When I set it to is Initial view controller then it shows.

I fixed this issue adding the transculent bar to the viewDidLoad

- (void)viewDidLoad{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.translucent = YES;
}

Hope this helps anyone encountering this issue.

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