0
votes

I have an iOS app that involves a UIWebView. There is javascript in the web view that reacts to scroll events. There is a way to make the web view scroll by tapping on one side or the other of the web view. The problem is that the javascript in the web view does not seem to pick up the scroll event when the scroll was done programmatically.

This is the code I use to scroll the web view:

[self.webView.scrollView setContentOffset:CGPointMake(targetX, y);

Is there a different way to do this so that the javascript reacts to the scroll? Or am I going to have to run javascript on the web view programmatically when the scroll event finishes?

1

1 Answers

0
votes

Have you tried this:

[self.webView.scrollView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];