简体   繁体   中英

Removing the rightBarButtonItem from moreNavigationController of UITabBarController

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?

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