有什么事可以通知晚饭吗?
我尝试了scrollViewDidScroll。但是它不被调用。
-(void)scrollViewDidScroll: (UIScrollView*)scrollView
{
NSLog(@"At the bottom...");
}
您必须将scrollview的委托设置为self
第一个(在webview中)。这样,scrollViewDidScroll:
您可以在滚动Web视图时调用它。因此,请尝试以下操作:
- (void)viewDidLoad
{
[super viewDidLoad];
self.webview.scrollview.delegate = self;
}
- (void)scrollViewDidScroll:(UIScrollView*)scrollview
{
CGPoint offset = scrollView.contentOffset;
CGRect bounds = scrollView.bounds;
UIEdgeInsets inset = scrollView.contentInset;
CGFloat currentOffset = offset.y + bounds.size.height - inset.bottom;
if (currentOffset - scrollView.contentSize.height <= 0)
{
NSLog(@"At the bottom...");
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句