我面临的问题是,我的 tableView 在我将其拉下(刷新)后不会停止刷新。我正在使用 github 上的 Yalantis“Pull to Refresh”存储库(可在此处找到: https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS )并尝试将其实现到我现有的项目中。
我已经实现了头文件,添加了属性,但在说明中它具有未刷新(如果您愿意)是链接到按钮的 IBAction。显然不是我想要的。这是我正在使用的代码
请记住,我已经取出了很多内容,只保留了相关的内容。任何帮助都会很棒。谢谢。
- (void)viewDidLoad {
[super viewDidLoad];
[self setupRefreshControl];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.sunnyRefreshControl startRefreshing];
PFQuery *query (i perform query for table)
}
# pragma mark - YALSunyRefreshControl methods
-(void)setupRefreshControl{
self.sunnyRefreshControl = [YALSunnyRefreshControl attachToScrollView:self.tableView
target:self
refreshAction:@selector(sunnyControlDidStartAnimation)];
}
-(void)sunnyControlDidStartAnimation{
// start loading something
[self.tableView reloadData];
}
-(IBAction)endAnimationHandle{
[self.sunnyRefreshControl endRefreshing];
}
最佳答案
实际上您可以随时调用该方法
[self.sunnyRefreshControl endRefreshing];
按钮处理程序只是示例 ^_^
(IBAction)endAnimationHandle{ [self.sunnyRefreshControl endRefreshing]; }
如果您仍有疑问,可以在 github repo 上创建问题。谢谢您
关于ios - 拉动刷新不会分离(不会停止刷新)-Objective-C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29664631/