Note that there are some explanatory texts on larger screens.

plurals
  1. POSuppress moreNavigationController in custom UITabBarController
    primarykey
    data
    text
    <p>I have implemented a custom UITabBar solution for a project. Essentially, if there are more than 5 items, I use a scrollView that will allow the user to scroll through the additional tab items and suppresses the more button. A similar look and feel can be seen in the Weather Channel app. </p> <p>Each tab bar item corresponds to a UINavigationController that manages the stack of views for each tab. The issue I'm having is when I have more than 5 tab items, from tab 5 onward does not correctly maintain the navigation stack. It seems that the moreNavigationController kills the navigation stack each time you return to that tab and you are brought to the initial page again.</p> <p>I've overridden the setSelectedViewController method as follows:</p> <pre><code>- (void) setSelectedViewController:(UIViewController *)selectedViewController { [super setSelectedViewController:selectedViewController]; if ([self.moreNavigationController.viewControllers count] &gt; 1) { self.moreNavigationController.viewControllers = [[NSArray alloc] initWithObjects:self.moreNavigationController.visibleViewController, nil]; } } </code></pre> <p>This code will remove the More functionality on the left nav button but it doesn't solve the issue of maintaining the navigation stack. All other tabs work fine. I can traverse down several views and the stack is maintained after I leave and return to that tab. I understand that this is a complicated issue so please let me know if there are areas where I can provide clarity. Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload