延伸:我們開發(fā)過工程中霍衫,使用MJRefresh的刷新空間最多,其實(shí)UITableViewController有一個自帶的下來刷新控件侯养,但使用的人不多敦跌。
創(chuàng)建:
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];
相關(guān)方法:
-(void)change:(UIRefreshControl*)con{
self.refreshControl.attributedTitle = [[NSAttributedString alloc]initWithString:@"開始刷新了~~"];
}
[self.refreshControl endRefreshing];
[self.refreshControl beginRefreshing];