TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2015 |
Maintained by Peng GuangBo.
使用Objective-c编写的下拉刷新控件,适用于各种UIScrollView,UITableView,UICollectionView,其特点是简洁大方。
拷贝并添加或推拽UpRefreshControl目录到你的项目目录里即可。
_refreshControl = [[UpRefreshControl alloc]initWithScrollView:self.tableView action:^(UpRefreshControl *control){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[control finishedLoadingWithStatus:@"Finished refresh" delay:1.f];
});
}];
[self.tableView addSubview:self.refreshControl];
[self.refreshControl finishedLoadingWithStatus:@"Finished refresh" delay:1.f];
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self.refreshControl scrollViewDidScroll];
}
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
[self.refreshControl scrollViewDidEndDragging];
}
// 自定义颜色
self.refreshControl.color = [UIColor blueColor];
// 自定义触发加载更多的阀值
self.refreshControl.refreshThreshold = 100.f;
To run the example project, clone the repo, and run pod install
from the Example directory first.
pgbo, [email protected]
UpRefreshControl is available under the MIT license. See the LICENSE file for more info.