gpt4 book ai didi

ios - 适当拉动刷新

转载 作者:行者123 更新时间:2023-11-29 10:43:11 25 4
gpt4 key购买 nike

是否有任何有效的方法来刷新库?

PullToRefresh-master 不工作

SVPullToRefresh-master 有错误

ODRefreshControl-master - 不是我想要的

最佳答案

有很多可用的库,但我建议您使用 UIRefreshControl . Apple 在 iOS6 中引入了 UIRefreshControl。您可以使用

将它集成到您​​的 UITableViewController 中
- (void)viewDidLoad {
[super viewDidLoad];
// Initialize Refresh Control
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
// Configure Refresh Control
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
// Configure View Controller
[self setRefreshControl:refreshControl];
}

refresh: 方法将触发更新,您可以在 API 回调中使用以下方法停止更新:

 [(UIRefreshControl *)sender endRefreshing];

关于ios - 适当拉动刷新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23459841/

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