更新时间:2022-06-26 07:48:45
我同意ElJay的评论,但要使用UITabBarControllerDelegate来回答问题
I agree with ElJay comment, but to answer the question use UITabBarControllerDelegate
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
在选择一个新选项卡时,请查看当前选项卡是否为tabBarController
的选项卡1 selectedIndex属性,如果是,则为popToRootViewController:
when a new tab is selected see if the current one is tab 1 selectedIndex property of tabBarController
and if so popToRootViewController: