neobie neobie - 1 year ago 83
iOS Question

Weird display issue when pushing from UITabBarController to UIPageViewController (video link)

Refer to the title mentioned, I am having weird display issue when pushviewcontroller from UITabBarController to UIPageViewController.

I am having such views:

- UITabBarController
-- MoreViewController
push to

with the following codes when I click "Alerts":

AlertsPageViewController *vc = [[UIStoryboard storyboardWithName:@"SBAlert" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"AlertsPageView"];
vc.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:vc animated:YES];

It leaves a big white space on the bottom of the screen with distorted tabbar at the bottom, until the "AlertsPageViewController" appear, only then it fill the gap below. When I click on "Back", the bottom bar also doesn't display probably. This behaviour only appear when I pushview to "UIPageViewController". If I push to normal "ViewController", it works correctly.

Tested on iOS9 and iOS10. How can I fix this?

Answer Source

Found out that other then using hidesBottomBarWhenPushed, another efficient way to hide the bottom bar is adding 1 line code

- (void) viewDidLoad
    [self.tabBarController.tabBar setHidden:YES];

at the pushed view (AlertsPageViewController).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download