如何在iOS 6/7中缩短拉动距离以激活拉动刷新操作? [英] How Do I Shorten the Pull Distance to Activate the Pull to Refresh Action in iOS 6/7?
问题描述
嘿StackOverflow人,
Hey StackOverflow People,
我一直试图弄清楚这个问题已经有一段时间但无济于事,我需要一些帮助。我有一个 UITableView
靠近我的应用程序底部,并且用户没有足够的屏幕距离来进行刷新。有没有人知道如何缩短在 UITableView上激活拉动刷新动作所需的距离(通过iOS 6/7中的
和 UIRefreshControl
) UIWebView
?
I've been trying to figure out this question for some time now but to no avail and I need some help. I have a UITableView
close to the bottom of my app and there's not enough screen distance for the user to engage the refresh. Does anybody know how I can shorten the distance it takes to activate the pull to refresh action (via a UIRefreshControl
in iOS 6/7) on a UITableView
andUIWebView
?
先谢谢大家!
推荐答案
根据Apple Docs,我认为没有办法修改 UIRefreshControl
参数。< br>
链接: https:/ /developer.apple.com/library/ios/documentation/uikit/reference/UIRefreshControl_class/Reference/Reference.html
As per the Apple Docs, I don't see any way to modify UIRefreshControl
parameters.
link: https://developer.apple.com/library/ios/documentation/uikit/reference/UIRefreshControl_class/Reference/Reference.html
使用第三方组件 ODRefreshControl (自定义滚动距离以激活刷新,修改 #define kMaxDistance
常量)。
Use a third-party component like ODRefreshControl (to customize the scroll-distance in order to activate the refresh, modify the #define kMaxDistance
constant).
不要使用 UIRefreshControl
而是在 -scrollViewDidScroll
方法中实现自己的逻辑,如:
Don't use the UIRefreshControl
and instead implement your own logic in the -scrollViewDidScroll
method like:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if ((scrollView.contentOffset.y + scrollView.frame.size.height) >= scrollView.contentSize.height) {
//refresh logic
}
}
这篇关于如何在iOS 6/7中缩短拉动距离以激活拉动刷新操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!