views:

981

answers:

3

I have a full screen UIWebView component on the screen with fixed size content, so no scrolling required. When I nudge the screen the content in moving up or down.

The same effect can one experience all over the iPhone when there is a scroll-enabled component.

I would like to prevent this happening in my application. Please shed some light...

A: 

If you don't need links to work:

myUIWebView.userInteractionEnabled = NO;
Nikolai Ruhe
+2  A: 

There seems to be a javascript that prevents scrolling while keeping the ability to click on links:

document.onload = function(){
    document.ontouchmove = function(e){ e.preventDefault(); }
};

I have not tested this and can't find any documentation. I consider it a hack.

Nikolai Ruhe
Thank you!This one worked even using only the ontouchmove event handler.I put this in the header of the HTML code:<script type=\"text/javascript\">document.ontouchmove = function(e){ e.preventDefault(); }</script>
+1  A: 
<script>
document.ontouchmove = function(event){
   event.preventDefault();
}
</script>

is more correct :)

alones
Without the quote, I guess?
Nikolai Ruhe
Maybe yes. right
alones