如何通过单击TabbarItem按钮获取Tabbar项目按钮的Click事件? [英] How can i get Tabbar Item Button's Click event by clicking on TabbarItem button?

查看:214
本文介绍了如何通过单击TabbarItem按钮获取Tabbar项目按钮的Click事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用了UITabbar,我使用了两个按钮作为TabItem。我想通过点击那两个按钮来执行两个不同的动作,那么如何在点击特定的Tabbar按钮时获得特定的动作。

I have taken UITabbar on that i have used two buttons as TabItem.I want to perform two different Action by clicking on that two button so how can i get particular Action on clicking on particular Tabbar button.

推荐答案

您最有可能想利用UITabBarControllerDelegate,然后处理didSelectViewController方法。

You most likely want to take advantage of the UITabBarControllerDelegate, and then handle the didSelectViewController method.

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController

有关详细信息,请参阅此处: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html

See here for more details: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITabBarControllerDelegate_Protocol/Reference/Reference.html

这篇关于如何通过单击TabbarItem按钮获取Tabbar项目按钮的Click事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆