uiscrollview - Preventing a UIWebView from scrolling after tapping a link -
i've got uiwebview
displaying long chunk of html multiple embedded images wrapped in links. webview scrollable content "below fold" accessible.
when links tapped, i'm using webview:shouldstartloadwithrequest:navigationtype:navigationtype
method catch specific javascript call, triggers modal load of uiviewcontroller on top of webview.
as link tapped, webview's contentoffset
reset 0,0
, page appears "jump" top. ideally, i'd webview's contentoffset
remain until modal view controller dismissed.
i've tried setting webview.scrollview.scrollenabled
property no
shouldstartloadwithrequest
method called - doesn't stop webview scrolling.
i've tried saving contentoffset
value @ point link tapped, , manually resetting - again, doesn't stop webview scrolling.
is there way of preventing scrolling happening??
this turns out nothing uiwebview
@ all, , standard browser behaviour.
the links in html in form
<a href="#" onclick="window.open('js-call:image-xx');"> <img src='foo.jpg'> </a>
the problem hadn't defined #
anchor, page scrolling top when altering html to
<a name="image-xx"> <a href="image-xx" onclick="window.open('js-call:image-xx');"> <img src='foo.jpg'> </a>
fixes issue.
Comments
Post a Comment