Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Turn off / disable Android webview zoom controls
Started by Prairiewest Mar 16 2018 10:08 PM

No replies to this topic
android webview zoom
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Prairiewest

[GLOBAL: userInfoPane.html]
Prairiewest
  • Observer

  • 26 posts
  • Corona SDK

There is an archived post asking about disabling Android zoom controls:

https://forums.coronalabs.com/topic/64938-is-it-possible-to-hide-android-webview-zoom-controls/

I couldn't reply to that post, so had to create this one.

 

I just ran into this, and solved it within the HTML of the webview itself.  Here's the line to add in the head portion of the HTML:

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
</head>
<body>
Stuff here that you do not want zoomed.
</body>
</html>

This only works if you are in control of the HTML - so either a locally served file, or a remote file from your server.  If you're displaying remote HTML from a 3rd party, you will still need to wait for the webview to be updated.

 

If you're adding this, don't forget to put it in the head section.




[topic_controls]
[/topic_controls]