OGeek|极客世界-中国程序员成长平台

标题: ios - 拉动刷新不会分离(不会停止刷新)-Objective-C [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 15:04
标题: ios - 拉动刷新不会分离(不会停止刷新)-Objective-C

我面临的问题是我的 tableView 在我拉下(刷新)它后不会停止刷新。我正在使用来自 github 的 Yalantis “Pull to Refresh” repo(可在此处找到:https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS)并尝试将其实现到我现有的项目中。

我已经实现了头文件,添加了属性,但是在说明中它的 unrefresh(如果你愿意的话)是一个链接到按钮的 IBAction。显然不是我想要的。这是我正在使用的代码


请记住,我已经拿出了很多东西,只是保留了相关的东西。任何帮助都会很棒。谢谢。

- (void)viewDidLoad {
[super viewDidLoad];

[self setupRefreshControl];

}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)viewWillAppearBOOL)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
                                                        refreshActionselector(sunnyControlDidStartAnimation)];
}

 -(void)sunnyControlDidStartAnimation{

// start loading something
[self.tableView reloadData];

}



-(IBAction)endAnimationHandle{

[self.sunnyRefreshControl endRefreshing];
}



Best Answer-推荐答案


其实你可以随时调用该方法

[self.sunnyRefreshControl endRefreshing];

按钮处理程序只是示例^_^

(IBAction)endAnimationHandle{  [self.sunnyRefreshControl endRefreshing];  }

如果您仍有问题,您可以在 github repo 上创建问题。 .谢谢你

关于ios - 拉动刷新不会分离(不会停止刷新)-Objective-C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29664631/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4