检查UIWebView是否滚动到底部 [英] check if UIWebView scrolls to the bottom
本文介绍了检查UIWebView是否滚动到底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当滚动时用户位于UIWebView的底部时,如何检查/调用方法?当用户位于内容的底部时,我想弹出一个视图(添加一个子视图)。
How do I check/call a method when a user is at the bottom of the UIWebView when scrolling? I want to popup a view (add a subiview) when the user is at the bottom of the content.
推荐答案
建立在其他想法, UIWebView
符合 UIScrollViewDelegate
协议。您可以继承 UIWebView
并覆盖相应的 UIScrollViewDelegate
方法,调用 [super ...]
所以原始行为仍然存在。
Building on other ideas here, UIWebView
conforms to the UIScrollViewDelegate
protocol. You could subclass UIWebView
and override the appropriate UIScrollViewDelegate
methods, calling [super ...]
so the original behavior is still present.
@interface SpecialWebview : UIWebView
@end
@implementation SpecialWebview
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[super scrollViewDidScroll:scrollView];
// Check scroll position and handle events as needed...
}
@end
这篇关于检查UIWebView是否滚动到底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文