首页 > 其他 > 详细

UIRefreshControl刷新

时间:2015-08-18 11:59:12      阅读:131      评论:0      收藏:0      [点我收藏+]
a. UIRefreshControl
/*
 iOS6之后
 1.创建一个UIRefreshControl 对象 (可以不设置大小和坐标)
 2.设置UIRefreshControl 对象 属性 增加 事件(下拉到一定程度松手就会触发事件)
 3.粘贴到要刷新的tableView上
 4. 实现增加事件触发的方法 (在这个方法内进行刷新数据)
 5.数据下载完之后要 停止刷新   [_refreshControl endRefreshing];
 
*/


//事件驱动型控件
    _refreshControl = [[UIRefreshControl  alloc] init];
    //属性字符串
    _refreshControl.attributedTitle = [[[NSAttributedString alloc] initWithString:@"下拉刷新"] autorelease];
    //设置背景
    _refreshControl.tintColor = [UIColor redColor];
    //增加 触发事件  值改变的时候
    [_refreshControl addTarget:self action:@selector(updateData:) forControlEvents:UIControlEventValueChanged];
    _refreshControl.backgroundColor = [UIColor yellowColor];
    //粘贴到tableView
    [self.tableView addSubview:_refreshControl];

UIRefreshControl刷新

原文:http://blog.csdn.net/shuju345/article/details/47748669

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!