gpt4 book ai didi

ios - 拉动刷新不会分离(不会停止刷新)-Objective-C

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:00:34 25 4
gpt4 key购买 nike

我面临的问题是我的 tableView 在我拉下(刷新)后不会停止刷新。我正在使用来自 github 的 Yalantis“Pull to Refresh”repo(在此处找到: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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com