且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS选项卡式应用程序具有表视图,如何重置表视图选项卡?初学者.

更新时间: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: