Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
178
rated 0 times [  183] [ 5]  / answers: 1 / hits: 120428  / 14 Years ago, sun, may 23, 2010, 12:00:00

Is there any way to completely disable web page scrolling in an iPhone web app? I've tried numerous things posted on google, but none seem to work.



Here's my current header setup:



<meta name=viewport content=width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;/>
<meta name=apple-mobile-web-app-capable content=yes/>


document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });



doesn't seem to work.


More From » iphone

 Answers
100

'self.webView.scrollView.bounces = NO;'



Just add this one line in the 'viewDidLoad' of the mainViewController.m file of your application. you can open it in the Xcode and add it .



This should make the page without any rubberband bounces still enabling the scroll in the app view.


[#96708] Wednesday, May 19, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mckenna

Total Points: 445
Total Questions: 109
Total Answers: 109

Location: Virgin Islands (U.S.)
Member since Sun, May 16, 2021
3 Years ago
;