开发者

How to check which Tab Bar item is active?

I am tr开发者_JAVA百科ying to figure out how to check which tab bar button is active? Currently I have 5 to 6 different tab bar buttons, and want to check which one is active. Any input will be appreciated here.

Thanks,

Shawn


do you have UITabbar or UITabbarController?

if UITabbar then set tag for each item and then you see which item is selected using -

tabBarController.tabBar.selectedItem.tag

if UITabbarController then use

tabBarController.selectedIndex


UITabBarController has a selectedViewController and a selectedIndex property. Here is the UITabBarController documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜