繁体   English   中英

获取UITabBarController的当前选项卡

[英]Getting the current tab of a UITabBarController

我有一个名为ATabBar的自定义类,它继承自UITabBarController。

我的.m课程中有以下内容:

- (void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
    NSInteger tab = self.tabBarController.selectedIndex;
}

似乎永远不会受到调试。 如何在标签栏中的功能中单击选项卡时如何抓取?

管理选定的选项卡

selectedViewController (Property)

selectedIndex (Property)

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM