cambraca
cambraca

Reputation: 27827

UIWebView: stop scrolling, but don't disable it

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?

Upvotes: 2

Views: 1069

Answers (1)

waylonion
waylonion

Reputation: 6976

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.

Upvotes: 2

Related Questions