iOS监听UITabBar的Tab点击事件
2016-05-31 10:55
495 查看
今天突然想到UITabBar如何监听tab点击事件,因为以前从来没有关注过,查了一下资料,UITabBar有代理方法可以监听:
1. 遵守代理协议:
@interface InspectorManagerViewController () <UITabBarDelegate>
2. 实现代理方法:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
LJLog(@"item name = %@", item.title);
}
1. 遵守代理协议:
@interface InspectorManagerViewController () <UITabBarDelegate>
2. 实现代理方法:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
LJLog(@"item name = %@", item.title);
}
相关文章推荐
- 347. Top K Frequent Elements
- iOS自定义UITableViewCell registerNib: 与 registerClass: 的区别
- Mirantis OpenStack Fuel8.0离线安装(MOS8.0本地源)
- iOS学习应用开发就业课_003:UIButton基本功能
- iOS开发:UITableView加载多张照片导致内存上涨的问题
- UITextField点击选中文字
- java.sql.SQLException: Connections could not be acquired from the underlying database!
- C#里System.Data.SQLite中对GUID的处理
- 实现placeholder属性的UITextView
- Mirantis OpenStack Fuel6.0安装使用—Step2
- String,StringBuffer,StringBuilder三者区别
- 两个非常不错的自定义UIAlertView第三方类库
- Android酷炫实用的开源框架(UI框架)
- Mirantis OpenStack Fuel6.0安装使用—Step1
- UE设置编码
- UIView
- UIWindow
- 点击UIViewController任意位置,收起键盘的3种方法
- String 、StringBuffer、 StringBuilder的区别
- UITableview刷新cell或section iOS