Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

[solved] webView page content size zoomed very small
Started by joshua325 Aug 26 2013 01:32 PM

- - - - -
2 replies to this topic
webview zoom size
[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

joshua325

[GLOBAL: userInfoPane.html]
joshua325
  • Observer

  • 6 posts
  • Corona SDK

I'm using a webView inside part of my app and all the data inside the webpage Im showing is inside a table that's 270px wide. I figured this would be a good width for displaying data on the iPhone (with the scrollbar it should take up most the width of the screen).

 

The content appears the right size in the Corona Mac Simulator but when I build for device, the webView window zooms way out so the content only takes up about 1/3 the width and 1/2 the height of the webView window.

 

Any idea how to fix this or set the webView so it will automatically zoom to make the page content's width fit appropriately?



[TOPIC: post.html]
#2

joshua325

[GLOBAL: userInfoPane.html]
joshua325
  • Observer

  • 6 posts
  • Corona SDK

Found the answer and I'll leave my topic here since a forum search didn't return any other solutions. I didn't test on Android but it works great on iPhones.

 

Put this code between the <head> and </head> tags of the page being shown:

 

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />



[TOPIC: post.html]
#3

stephen.raymundo

[GLOBAL: userInfoPane.html]
stephen.raymundo
  • Observer

  • 7 posts
  • Corona SDK

Hello Joshua, I encountered this problem and what you shared helped so much. I just wanted to ask where did you get the solution, would be nice to know how it was related to the webView.

 

Thanks!




[topic_controls]
[/topic_controls]