AllAroundPullView 允许您实现 4 方向的 Pull-To-Refresh 功能。
AllAroundPullView.h/m 和箭头图片
导入到您的项目中。#import "AllAroundPullView.h"
AllAroundPullView *pull = [[AllAroundPullView alloc] initWithScrollView:scrollView
position:AllAroundPullViewPositionTop
action:^(AllAroundPullView *view){
// do anything
[view performSelector:@selector(finishedLoading) withObject:nil afterDelay:0.0f];
}];
[scrollView addSubview:pull];
[pull release];
您可以从属性中自定义 timeout, threshold, activityView
。
@property (nonatomic, assign) NSTimeInterval timeout; // default is nothing.
@property (nonatomic, assign) CGFloat threshold; // default is 60.0f
// default is UIActivityIndicatorViewStyleWhiteLarge
@property (nonatomic, retain) UIActivityIndicatorView *activityView;
因此,像这样。
pull.timout = 10.0f;
pull.threshold = 120.0f;
pull.activityView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
维护在 noARC
和 delegate
分支中。
查看 LICENSE 文件。