[MonoTouch] UIWebView different behavior between devices with iOS5 and lower than iOS5 in combination with both SDK 4.3 and SDK 5.0
Danny Pronk
dpronk at probe-asp.eu
Thu Oct 20 08:37:44 EDT 2011
Hi All,
I have a UIWebView on my main window and a delegate attached to that
UIWebView.
Inside the Delegate I am using the ShouldStartLoad override to handle some
stuff internally instead of doing an actual navigation.
So when I do something internally i return false and if I want the request
to handle stuff normally i return true;
So far so good and the application has been working well on all iOS versions
below 5.
With iOS5 I have the following behavior all of a sudden.
On the first click inside (let's say a hyperlink) things work as expected.
But when i click a different (second) hyperlink, the ShouldStartload is
actually fired twice!!!
One time with the PREVIOUS request and then the second time with the newly
clicked link information.
Can anybody tell me what I did wrong or how to get rid of this behavior
please!
public override bool ShouldStartLoad (UIWebView webView, NSUrlRequest
request, UIWebViewNavigationType navigationType)
{
//We only check if the action in UIWebView is of the type that a LINK is
clicked!
//So it will only work with actual Hyperlinks! NOT WITH
if (navigationType == UIWebViewNavigationType.LinkClicked)
{
string url = request.Url.AbsoluteString;
//Here i do some custom stuff so I don't have to navigate further
//On iOS5, when you click a second LINK the ShouldStartLoad is fired
twice!
//First time with the previous clicked link and second time
//with the actual intended link.
//And finally i return false; to cancel the operation
return false;
}
else
{
return true;
}
Help would be greatly appreciated
Regards
Danny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111020/21965003/attachment.html
More information about the MonoTouch
mailing list