2011-04-19 89 views

回答

3

的UITabBarController有selectedViewController和selectedIndex属性。这里是UITabBarController documentation

+0

Link是现在死了,这是正确的链接: https://developer.apple.com/library/ios/documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html – CyberMew 2014-09-08 06:28:04

14

你有UITabbar或UITabbarController吗?

如果UITabbar然后设置每个项目的标签,然后你看到哪个项目使用选择 -

self.tabBarController.tabBar.selectedItem.tag 

如果的UITabBarController然后用

self.tabBarController.selectedIndex 
+0

感谢您的答案球员,但我做了使用ViewWillDisappear不同的方法,并做了诀窍。 – 2011-04-28 17:12:52

+0

应该是正确的答案,谢谢! – iDev 2014-10-04 12:38:59

相关问题