I'm seeing a lot of answers on how to disable scrolling in a web view, but what I'm after is different: say the user is scrolling the webview, and the finger is not on the device anymore, but it's still scrolling (it hasn't stopped, but it's decelerating, this can take up to a second or so). Then, they tap a button. I want the UIWebView to stop scrolling immediately (i.e. cancel its current scrolling). Is this possible?
Asked
Active
Viewed 1,061 times
1 Answers
2
The UIWebView class conforms to the UIScrollViewDelegate, thus by using this answer here: How can I programmatically force-stop scrolling in a UIScrollView? you can stop scrolling by manually setting the content offset.
-
1nice! For future reference, it works with this code: `[[myWebView scrollView] setContentOffset:[[myWebView scrollView] contentOffset] animated:NO];` – cambraca May 07 '12 at 20:14