Can I scale webview? I need to load a page zoomed in 200%

First of all, Thanks for taking the time to read this post.

I am trying to view a website  through my app but the pages need to be zoomed in 150-200% to read it.

You can click the button and it load the page, but you have to manually zoom to read the text. Is there any way that I can automatically zoom in 200%?

Below is the whole code, it’s just a bunch of examples pieced together so if you have any advice an syntax I would appreciate that too.

line 31 : (the web view, but as is the text is far too small and you can not read it without zooming)

local function handleButtonEvent( event )

if ( “ended” == event.phase ) then
print( “Button was pressed and released” )

native.showWebPopup( 0,-45, display.contentWidth, display.contentHeight - 40,("http://www.google.com"))
    --//////THIS IS THE PART I AM TRYING TO VIEW, IT NEEDS TO BE ZOOMED IN 200%////////        
end
end

----------------------------------------------------------------------------------------- -- -- view1.lua -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local scene = composer.newScene() function scene:create( event ) local sceneGroup = self.view -- Called when the scene's view does not exist. -- -- INSERT code here to initialize the scene -- e.g. add display objects to 'sceneGroup', add touch listeners, etc. -- create a white background to fill screen --local background = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) --background:setFillColor( .5 ) -- white local background = display.newImageRect( "background1.png", 320, 570 ) background.x = display.contentCenterX background.y = display.contentCenterY --add text local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) native.showWebPopup( 0,-45, display.contentWidth, display.contentHeight - 40,("http://www.theaustinexplorer.com/?m=1")) --//////THIS IS THE PART I AM TRYING TO VIEW, IT NEEDS TO BE ZOOMED IN 200%//////// end end local button1 = widget.newButton( { width = 173, height = 47, labelColor = { default={ 1, 1, 1 }, over={ 1, 1, 1, 1 } }, defaultFile = "button9.png", overFile = "button8.png", label = "button", onEvent = handleButtonEvent } ) -- Center the button button1.x = display.contentCenterX button1.y = display.contentCenterY -- Change the button's label text button1:setLabel( " JUMP! " ) -- all objects must be added to group (e.g. self.view) --sceneGroup:insert( background ) --sceneGroup:insert( title ) --sceneGroup:insert( summary ) end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if phase == "will" then -- Called when the scene is still off screen and is about to move on screen elseif phase == "did" then -- Called when the scene is now on screen -- -- INSERT code here to make the scene come alive -- e.g. start timers, begin animation, play audio, etc. end end function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if event.phase == "will" then -- Called when the scene is on screen and is about to move off screen -- -- INSERT code here to pause the scene -- e.g. stop timers, stop animation, unload sounds, etc.) elseif phase == "did" then -- Called when the scene is now off screen end end function scene:destroy( event ) local sceneGroup = self.view -- Called prior to the removal of scene's "view" (sceneGroup) -- -- INSERT code here to cleanup the scene -- e.g. remove display objects, remove touch listeners, save state, etc. end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) ----------------------------------------------------------------------------------------- return scene

Any advice you have would be helpful! Thank you for reading!

Native display objects are a little limited in Corona SDK. I don’t see anything here related to zoom in the native web view content.

DoDi

There really isn’t a Corona way to do this. If the webView offers a zoom option, the user can tap on the zoom option, but I’m not sure how to do it programmatically.

You might have some success messing with CSS settings in the <head> tag of the HTML if you have access to it, but that wouldn’t be Corona specific.

Rob

This might help out:

[https://stackoverflow.com/questions/1156278/how-can-i-scale-an-entire-web-page-with-css](https://stackoverflow.com/questions/1156278/how-can-i-scale-an-entire-web-page-with-css\)

Assuming you can access the CSS. 

Honestly, I see nothing wrong with manual zooming…

I can, but I don’t want the website zoomed in 150% when viewing on a computer. Is there a conditional if android, then zoom I could use?

Yes. Check the documentation for

system.getInfo()

This method can tell you plenty of stuff about the platform running the application.

Native display objects are a little limited in Corona SDK. I don’t see anything here related to zoom in the native web view content.

DoDi

There really isn’t a Corona way to do this. If the webView offers a zoom option, the user can tap on the zoom option, but I’m not sure how to do it programmatically.

You might have some success messing with CSS settings in the <head> tag of the HTML if you have access to it, but that wouldn’t be Corona specific.

Rob

This might help out:

[https://stackoverflow.com/questions/1156278/how-can-i-scale-an-entire-web-page-with-css](https://stackoverflow.com/questions/1156278/how-can-i-scale-an-entire-web-page-with-css\)

Assuming you can access the CSS. 

Honestly, I see nothing wrong with manual zooming…

I can, but I don’t want the website zoomed in 150% when viewing on a computer. Is there a conditional if android, then zoom I could use?

Yes. Check the documentation for

system.getInfo()

This method can tell you plenty of stuff about the platform running the application.