您的位置:首页 > 产品设计 > UI/UE

系统默认的刷新方法(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];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: