UIWebview on scroll event

2019-09-01 11:03发布

I want to know how to call a method in the event that a user has stopped scrolling on a page inside UIWebview.

Does anyone know how to do this?

1条回答
放荡不羁爱自由
2楼-- · 2019-09-01 11:44

UIScrollView has also a subView of the UIWebView :

So you can fire at the delegate of UIScrollView's :

webView.scrollView.delegate = self
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
   //Do your  Stuff
}

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView 
                  willDecelerate:(BOOL)decelerate
{
    if (!decelerate) {
        //Do your  Stuff
    }
}

Check the Doc

查看更多
登录 后发表回答