簡體   English   中英

檢測何時選擇UITabBarController More選項卡

[英]Detect when UITabBarController More tab is selected

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

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

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

在發布問題后立即找到它:

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

另一種方法:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM