Removing the rightBarButtonItem from moreNavigationController of UITabBarController

亡梦爱人 提交于 2019-12-07 10:18:59

问题


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.


回答1:


I used

tabController.customizableViewControllers = nil;

and it worked fine :)




回答2:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!