2013-03-04 46 views
3

如何檢測何時選擇UITabBarController的特殊更多選項卡?當選擇UITabBarController更多選項卡時檢測到

tabBarController:didSelectViewController:告訴我何時選擇了一個選項卡,包括更多選項卡。但是,我怎麼知道給定的UIViewController實際上是更多選項卡?

起初我雖然關於使用索引,但假設更多選項卡將處於相同的位置。此外,標題(「更多」)似乎是本地化的。

回答

3

張貼問題之後發現:

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController 
{ 
    if (tabBarController.moreNavigationController == viewController) { 
     NSLog(@"More"); 
    } 
} 
2

的另一種方法:

if (tabBarController.selectedIndex == NSNotFound) { 
    // etc. 
} 
+0

是這樣記錄的地方? – hpique 2013-03-04 16:07:46

+0

@hpique http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html – 2013-03-04 16:25:43

+0

+1感謝您的回覆。 – hpique 2013-03-05 01:21:30

相關問題