The more I work with widgets, the more they seem to suck! I know they’re not part of openGL canvas blah blah, but c’mon, surely there must be a straightforward way to get native webView to fill the screen on orientation shift?
Here’s a dead simple idea of what I’m trying to achieve:
local function onOrientationChange( event ) local direction = event.type local delta = event.delta screenOffsetW, screenOffsetH = display.contentWidth - display.viewableContentWidth, display.contentHeight - display.viewableContentHeight tabBar.x = display.contentWidth\*.5 if direction == "landscapeLeft" or direction == "landscapeRight" then myWeb.width = display.contentWidth myWeb.height = display.contentHeight myWeb.x = display.contentWidth\*.5 myWeb.y = display.contentHeight\*.5 + tab.height myWeb.anchorX = 0.5 myWeb.anchorY = 0.5 else myWeb.width = display.contentWidth myWeb.height = display.contentHeight myWeb.x = display.contentWidth\*.5 myWeb.y = display.contentHeight\*.5 + tab.height myWeb.anchorX = 0.5 myWeb.anchorY = 0.5 end
…It’s not rocket science is it? “myWeb” is a native.webView by the way.
Works fine on the simulator (getting sick of saying that), rotates fine, but WILL NOT rescale on device. This has been raised lots of times, please tell me there’s a simple fix or method that I’ve missed, otherwise this is a mission critical feature that plain don’t work. Might as well use Wordpress and Phonegap.
I’m using version 2014.2381 (2014.7.25)
Any pointers would be gratefully appreciated. 8 hours spent on a function that should pretty much write itself is not good.