Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Webview rotations and width
Started by gturmo Jun 21 2018 03:32 PM

1 reply to this topic
webview
[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

gturmo

[GLOBAL: userInfoPane.html]
gturmo
  • Observer

  • 24 posts
  • Corona SDK

Hi,

 

I'm trying to create a simple CoronaSDK app to show my website. I would like that when users rotate his device can show website at landscape position. To do it I created following sentence at build.setting file:

settings ={
orientation =
    {
        default = "portrait",    -- Initial launch orientation
        supported = {"landscapeLeft"},  -- Table of allowed options for auto-orientation
    },
    android =
    {
        usesPermissions =
        {
            "android.permission.INTERNET",
        },
    },
}

My config.lua:

 

application =
{
content = 
{
width = 320,
height = 480,
scale = "letterbox",
xAlign = "left",
yAlign = "top"
},
}

And main.lua:

 

local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 480 )
webView:request( "http://www.nursicum.com/frontpage" )

 It works correctly, but I detecte two bugs:

 

1.- When I'm in vertical mode, there is a black area at bottom of display that are not filled with webview widget. How can I do to use all of this area?

2.- When I rotate my Android device, webpageview it rotate with them but width pixels are the same that in vertical mode. And the problem is that it loses a lot of display.

 

I attached two captures about them.

 

Thanks,

 

 

 

 

Attached Files



[TOPIC: post.html]
#2

gturmo

[GLOBAL: userInfoPane.html]
gturmo
  • Observer

  • 24 posts
  • Corona SDK

HI,

 

I'm continue working with this problem but I doesn't found any solution. Can anyone help me, please? I attached my code here.

Attached Files




[topic_controls]
[/topic_controls]