我认为你需要编写自己的解决方案.但实际上并不那么难.
您需要创建一个包含可伸展图像的自定义表头视图,并在您的图像中实现一些处理UITableViewDelegate.下面是自定义刷新控件处理的相当通用的实现.
1)创建一个自定义UIView作为下拉指示器视图:
头文件:
#import <UIKit/UIKit.h>
typedef enum UpdateListViewState
{
UpdateListViewStatePull,
UpdateListViewStateRelease,
UpdateListViewStateUpdate
}UpdateListViewState;
@interface UpdateListView : UIView
@property (nonatomic,readwrite) UpdateListViewState state;
@property (nonatomic,strong) UIImageView imageView;
@end
Run Code Online (Sandbox Code Playgroud)
2)将headerView指定为tableView标头:
self.header = [[UpdateListView alloc] init];
self.table.tableHeaderView = self.header;
Run Code Online (Sandbox Code Playgroud)
3)在你的UITableViewDelegate,实现表滚动处理:
const int UPDATE_DRAG_HEIGHT = -70;
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{
if (self.header.state == UpdateListViewStateRelease) {
//Perform update stuff here & perhaps refresh animation
self.header.state = UpdateListViewStateInitial;
}
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//adjust size of self.header.imageView here according to scrollView.ContentOffset
if (scrollView.contentOffset.y < UPDATE_DRAG_HEIGHT && self.header.state != UpdateListViewStateUpdate) {
self.header.state = UpdateListViewStateRelease;
}
}
Run Code Online (Sandbox Code Playgroud)