延伸:我们开发过工程中,使用MJRefresh的刷新空间最多,其实UITableViewController有一个自带的下来刷新控件,但使用的人不多。
创建:
self.refreshControl = [[UIRefreshControl alloc]init];
self.refreshControl.tintColor = [UIColor greenColor];
self.refreshControl.attributedTitle = [[NSAttributedString alloc]initWithString:@"下拉刷新了~~"];
[self.refreshControl addTarget:self action:@selector(change:) forControlEvents:UIControlEventValueChanged];
相关方法:
-(void)change:(UIRefreshControl*)con{
self.refreshControl.attributedTitle = [[NSAttributedString alloc]initWithString:@"开始刷新了~~"];
}
[self.refreshControl endRefreshing];
[self.refreshControl beginRefreshing];