美文网首页
UITableViewController自带下拉刷新空间-UI

UITableViewController自带下拉刷新空间-UI

作者: 酱油之神 | 来源:发表于2016-11-01 16:40 被阅读64次

延伸:我们开发过工程中,使用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];

相关文章

网友评论

      本文标题:UITableViewController自带下拉刷新空间-UI

      本文链接:https://www.haomeiwen.com/subject/divmuttx.html