Question

In my UIWebView when an anchor is clicked I catch it in ShouldStartLoad and always return false to cancel it. (I treat the clicks as command to do things)

Strangely the ShouldStartLoad only fires once if the same anchor is clicked more than once in a row.

Eg: Click "A", Click "A" - ShouldStartLoad receives "A" once

Click "A", Click "B", Click "A" - ShouldStartLoad receives "A", then "B" then "A"

Is there a way to make ShouldStartLoad receive "A" twice when clicked twice in a row?

I have tried changing the URL of "A" each time so that every click is a different url. However it appears that once I click an element clicking it again simply does not fire ShouldStartLoad until I click a different element.

Was it helpful?

Solution

As a work around in ShouldStartLoad I do this to cause the page the re-register that it's new. Not sure why it works, but it does.

webView.EvaluateJavascript ("document.location='#';");

(I use MonoTouch)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top