Removing the BarButtonItem right from moreNavigationController UITabBarController

I added tabBarto my application and removed rightBarButtonItemwith the code:

UITableView *moreTableView = (UITableView *)tabController.moreNavigationController.topViewController.view;
    tabController.moreNavigationController.navigationBar.topItem.rightBarButtonItem = nil;

Now when I switch to another screen and press the button More tabBar, it will appear again rightBarButtonItem. If I use the reverse navigation button, it does not appear and works fine. However, when I press the button Moreon the tabBar, it appears again.

+4
source share
2 answers

I used

tabController.customizableViewControllers = nil;

and it worked fine :)

+3
source

You must name navigationItem.rightBarButtonItem = nilin each viewControllers viewDidLoadwhere you want to get rid of it.

, ?

+2

Source: https://habr.com/ru/post/1670416/


All Articles