IOS tabbar 点击刷新页面
2015-07-06 17:24
429 查看
参考网上资料
.h文件
.m文件
在NoticeTableViewController 中写好刷新方法。即可点击tab刷新页面
.h文件
[code]#import <UIKit/UIKit.h> @interface TabbarRootViewController : UITabBarController<UITabBarControllerDelegate> @end
.m文件
[code]#import "TabbarRootViewController.h" #import "NoticeTableViewController.h" @implementation TabbarRootViewController -(void)viewDidLoad{ [super viewDidLoad]; self.delegate=self; } -(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{ if (viewController.tabBarItem.tag==2) { UINavigationController *navigation =(UINavigationController *)viewController; NoticeTableViewController *notice=(NoticeTableViewController *)navigation.topViewController; [notice refreshData]; } } //禁止tab多次点击 -(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{ UIViewController *tbselect=tabBarController.selectedViewController; if([tbselect isEqual:viewController]){ return NO; } return YES; } @end
在NoticeTableViewController 中写好刷新方法。即可点击tab刷新页面
相关文章推荐
- iOS解决两个静态库的冲突 duplicate symbol
- iOS导出说明文档
- iOS学习之iOS沙盒(sandbox)机制和文件操作(一)
- ios学习笔记:ios数据持久化
- ios子视图和父视图同时处理输入事件
- iOS 后台定位需要注意的两个问题
- ios学习笔记:利用sizeclass匹配不同设备
- iOS 处理方法中的可变参数
- iOS多线程入门之NSThread,NSOperation,GCD
- nagios 监控交换机端口
- iOS 各种手势集合
- iOS之富文本
- iOS 一个带动画的等待指示器
- iOS开发的经典博客和文章汇总
- iOS textfield限制长度,中文占2字符,英文占1字符
- iOS运行时runtime初探(强制获取并修改私有变量,强制增加及修改私有方法等)
- [转载]ios 开发 icon图标设置
- 提交IOS应用更新时遇到的错误提示!ERROR ITMS-90186/90062
- iOS开发的一些事
- iOS AutoLayout详解