系统默认的刷新方法(UIRefreshControl)
2016-03-05 15:31
483 查看
系统默认的刷新方法(下拉)
@property (nonatomic, retain) UIRefreshControl *control;
- (void)viewDidLoad {
[super viewDidLoad];
//系统默认的刷新(下拉)
self.control = [[UIRefreshControl alloc] init];
self.control.attributedTitle = [[NSAttributedString alloc] initWithString:@"正在加载数据..."];
[self.view addSubview:self.control];
[_control release];
[self.control addTarget:self action:@selector(changeValue:) forControlEvents:UIControlEventValueChanged];
}
- (void)changeValue:(UIRefreshControl *)control {
[self.control endRefreshing]; // 关闭刷新效果
[self.nameList addObject:@"someOne"];
[self.tableView reloadData];
}
@property (nonatomic, retain) UIRefreshControl *control;
- (void)viewDidLoad {
[super viewDidLoad];
//系统默认的刷新(下拉)
self.control = [[UIRefreshControl alloc] init];
self.control.attributedTitle = [[NSAttributedString alloc] initWithString:@"正在加载数据..."];
[self.view addSubview:self.control];
[_control release];
[self.control addTarget:self action:@selector(changeValue:) forControlEvents:UIControlEventValueChanged];
}
- (void)changeValue:(UIRefreshControl *)control {
[self.control endRefreshing]; // 关闭刷新效果
[self.nameList addObject:@"someOne"];
[self.tableView reloadData];
}
相关文章推荐
- N1:Stack Queue DFS BFS
- 让UITableViewCell的分隔线宽度等于屏幕的宽度
- UESTC 758 P酱的冒险旅途
- openstack-glance-api.service start request repeated too quickly, refusing to start
- HDU 1297 Children’s Queue 递归+大数
- iOS UIActionSheet提示框
- ugui 中有关grid layout group的适配问题
- UVA 10689 Yet another Number Sequence(矩阵快速幂求Fib数列)
- UVA 10689 Yet another Number Sequence(矩阵快速幂求Fib数列)
- UITapGestureRecognizer 的使用,判断点击哪个控件
- QuickSort 快排算法 java
- require笔札
- Handler中的四种更新UI写法
- poj--3061--Subsequence(贪心)
- poj--3061--Subsequence(贪心)
- UESTC 758-P酱的冒险旅途【BFS】
- 今日开讲—— easyui-combobox动态赋值
- LeetCode 51 - N-Queens II
- Ngui 拖拽到底部,直接循环到顶部
- Uva1594 Ducci Sequence