Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Can't believe that webView still doesn't scale.Seriously?
Started by Caithan Games Aug 07 2014 01:51 PM

- - - - -
3 replies to this topic
webview scaling orientation
[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

Caithan Games

[GLOBAL: userInfoPane.html]
Caithan Games
  • Enthusiast

  • 86 posts
  • Corona SDK

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.



[TOPIC: post.html]
#2

Caithan Games

[GLOBAL: userInfoPane.html]
Caithan Games
  • Enthusiast

  • 86 posts
  • Corona SDK

The silence on this subject is deafening.



[TOPIC: post.html]
#3

Alex@Panc

[GLOBAL: userInfoPane.html]
Alex@Panc
  • Corona Geek

  • 1,733 posts
  • Corona SDK

What happens when you remove and re-create the webView?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,062 posts
  • Enterprise

Can you produce a sample app that shows this issue.  The code you have above isn't complete and we don't see how you're creating the web view.  Also without your config.lua and build.settings its going to be very difficult to help.

 

Rob




[topic_controls]
[/topic_controls]