简体   繁体   中英

How to only disable the horizontal scrolling of UIwebView from within the iPhone app?

I am making a iPhone app that needs to make a UIwebview that can only scroll vertically(I need to disable to the horizontal scrolling), I can't really do it from the website because that's not in my control. How to implement that?

You can do this by adding the following in the section of your HTML:

<meta name="viewport" content="width=device-width" />

Do this either before you load the file into the web view or use stringByEvaluatingJavaScriptFromString:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM