I have added tabBar
in my app and remove the rightBarButtonItem
with the code:
UITableView *moreTableView = (UITableView *)tabController.moreNavigationController.topViewController.view;
tabController.moreNavigationController.navigationBar.topItem.rightBarButtonItem = nil;
Now, when I navigate to other screen and click More
button of tabBar
, rightBarButtonItem
appears again. If I uses back navigation button it doesn't appear and works fine. However, when I tap More
button from tabBar it appears again.
I used
tabController.customizableViewControllers = nil;
and it worked fine :)
You should call navigationItem.rightBarButtonItem = nil
in each viewControllers viewDidLoad
where you want to get rid of it.
Otherwhise could you show more code of your implementation?
来源:https://stackoverflow.com/questions/42367642/removing-the-rightbarbuttonitem-from-morenavigationcontroller-of-uitabbarcontrol