- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我面临的问题是我的 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/
我有一个包含 5 个选项卡的选项卡栏,每个选项卡都包含一些数据。当用户下拉刷新时,我想显示一个刷新指示器,并且选项卡内的数据应该通过 API 调用进行更新。下面是我到目前为止尝试过的代码。 帮助我了解
我正在尝试使用 CollapsingToolbarLayout 和 AppBarLayout 底部的其他 View 来创建以下行为,但是当我滚动时栏没有折叠/展开/拉动 PullView,这意味着在使
我正在尝试在 React Native 中构建类似于 IMessage 和 WhatsApp 标题的内容,用户可以向下拉以显示标题中的搜索栏。 我已经能够向下拉以显示隐藏的输入,但由于 ScrollV
我希望让我的页面具有响应性,添加了 Bootstrap 并将我的两个 div 排成一行,放在一个流体容器中。 我尝试向左按钮添加向右拉/向右浮动,向右图像向左拉/向左浮动,但它们没有移动。 我没有使用
如何使用简单的饼图从下面的 s:variant 块中获取标题标签? product_variants-96590662 Default Title 10.00 002 0 我已
我已经编写了一些代码,使用 Instagram 图形 API 从 Instagram 中提取图像。一切工作正常,但性能很慢。我正在使用 JavaScript,但也遇到了同样的问题,但使用 PHP 时情
我是一名优秀的程序员,十分优秀!