UITabBarItem 如何触发点击事件
2015-09-18 13:35
519 查看
在Tab Bar里放了 2个Item按钮 但是UITabBarItem没有触发方法的属性 和方法, 但是找到一种可以实现这个效果的 在.h文件里加上<UITabBarDelegate>后就可以调用下面的代理方法, 再在viewDidLoad里加上 [tabBar setDelegate:self];就可以了 #pragma mark -- UITabBarDelegate -(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)Item{ if (tabBar == bottomBar) { if (Item.tag == 0) { NSLog(@"select ALL"); Item.image = dPicMsg_CANCEL_SELALL; [self selectAllClicked:Item]; } else if(Item.tag ==1){ [self deleteClicked:Item]; NSLog(@"----00000delete ---"); } }else{ } NSLog(@"\n didSelect item -----\n "); }
相关文章推荐
- 【Mockplus教程】重命名
- 【Mockplus教程】删除
- 【Mockplus教程】复制/克隆
- 关机时windows发的消息WM_QUERYENDSESSION
- 【Mockplus教程】收藏和重用
- 【Mockplus教程】标尺和参考线
- UILabel设置行间距及字体色彩
- Entity Framework 6 执行Linq to Entities异常"p__linq__1 : String truncation: max=0, len=2, value='测试'"
- UITextView
- UILabel textAlignment in IOS6
- easyUI之message
- (原创)iOS中cell高度自适应方法UITableView设置
- UILabel自适应高度和自动换行
- 让你明白response.sendRedirect()与request.getRequestDispatcher().forward()区别
- [!] Unable to satisfy the following requirements:众里寻他千百度。
- ecshop 的transport.js 与jqueyr冲突
- 交互设计的基本方法(概述篇)
- VirtualBox安装增强工具时:Unable to install guest additions: unknown filesystem type 'iso9660'
- codeforces 566F. Clique in the Divisibility Graph dp
- easyui——datebox控件限制输入的日期