Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Widget 2.0 Tabbar Falling Off Screen In "landscape" Orientation
Started by buzzard1447 Mar 13 2013 02:09 AM

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

buzzard1447

[GLOBAL: userInfoPane.html]
buzzard1447
  • Observer

  • 6 posts
  • Corona SDK

I am trying to place a tabBar along the botton of the display. Using "display.contentHeight" and subtracting the height of the tabBar works transitioning from "portrait" to "landscape" on the iPhone and iPhone4, but on the iPhone5, the tabBar falls off the bottom of the display unseen ("landscape" orientation on the simulator). When I print the number in "display.contentHeight", it returns 320. But apparently the tabBar is using some other number. I have tried substituting "display.viewableContentHeight" but it acts the same. If I detect orientation and then translate, I would have to detect each device and give it a hard number to keep the tabBar viewable at the bottom. If I don't detect each device when "translating", the tabBar ends up floating somewhere above the bottom of the screen.

 

Also, the tabBar obtains by default a width of "display.contentWidth" according to the docs. However, when orientation is "landscape" the tabBar simply continues with the original width while in "portrait". The return of "display.contentWidth" is 480 but it ignores this and stays at 320 in "landscape". I have tried leaving tabBar.width at default and assigning it as display.contentWidth or display.viewableContentWidth, it continues to work the same.

 

The build file I have specifies that all orientations are supported. Placing the tabBar at the top of the display works flawlessly on all devices...is this the intention?

 

 



[TOPIC: post.html]
#2

Danny

[GLOBAL: userInfoPane.html]
Danny
  • Corona Geek

  • 2,597 posts
  • Corona Staff

I am trying to place a tabBar along the botton of the display. Using "display.contentHeight" and subtracting the height of the tabBar works transitioning from "portrait" to "landscape" on the iPhone and iPhone4, but on the iPhone5, the tabBar falls off the bottom of the display unseen ("landscape" orientation on the simulator). When I print the number in "display.contentHeight", it returns 320. But apparently the tabBar is using some other number. I have tried substituting "display.viewableContentHeight" but it acts the same. If I detect orientation and then translate, I would have to detect each device and give it a hard number to keep the tabBar viewable at the bottom. If I don't detect each device when "translating", the tabBar ends up floating somewhere above the bottom of the screen.

 

Also, the tabBar obtains by default a width of "display.contentWidth" according to the docs. However, when orientation is "landscape" the tabBar simply continues with the original width while in "portrait". The return of "display.contentWidth" is 480 but it ignores this and stays at 320 in "landscape". I have tried leaving tabBar.width at default and assigning it as display.contentWidth or display.viewableContentWidth, it continues to work the same.

 

The build file I have specifies that all orientations are supported. Placing the tabBar at the top of the display works flawlessly on all devices...is this the intention?

 

Hey.

 

Can you post up your config.lua file please? 



[TOPIC: post.html]
#3

buzzard1447

[GLOBAL: userInfoPane.html]
buzzard1447
  • Observer

  • 6 posts
  • Corona SDK

Sure, this is from one of the tutorials:

 

[code=auto:0]

system.getInfo("model")if ( string.sub( system.getInfo("model"), 1, 4 ) == "iPad" ) then
    application =
        {
            content =
                {
                    width = 360,
                    height = 480,
                    scale = "letterBox",
                    xAlign = "center",
                    yAlign = "center",
                    imageSuffix =
                    {
                        ["@2x"] = 1.5,
                        ["@4x"] = 3.0,
                    },
                },
        }
    
elseif ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" and display.pixelHeight > 960 ) then
    application =
        {
            content =
                {
                    width = 320,
                    height = 568,
                    scale = "letterBox",
                    xAlign = "center",
                    yAlign = "center",
                    imageSuffix =
                    {
                        ["@2x"] = 1.5,
                        ["@4x"] = 3.0,
                    },
                },
        }elseif ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" ) then
    application =
        {
            content =
                {
                    width = 320,
                    height = 480,
                    scale = "letterBox",
                    xAlign = "center",
                    yAlign = "center",
                    imageSuffix =
                    {
                        ["@2x"] = 1.5,
                        ["@4x"] = 3.0,
                    },
                },
        }
    
elseif ( display.pixelHeight / display.pixelWidth > 1.72 ) then
    application =
        {
        content =
            {
                width = 320,
                height = 570,
                scale = "letterBox",
                xAlign = "center",
                yAlign = "center",
                imageSuffix =
                {
                    ["@2x"] = 1.5,
                    ["@4x"] = 3.0,
                },
            },
        }
 
else
    application =
        {
        content =
            {
                width = 320,
                height = 512,
                scale = "letterBox",
                xAlign = "center",
                yAlign = "center",
                imageSuffix =
                {
                    ["@2x"] = 1.5,
                    ["@4x"] = 3.0,
                },
            },
    }
 
end



[TOPIC: post.html]
#4

buzzard1447

[GLOBAL: userInfoPane.html]
buzzard1447
  • Observer

  • 6 posts
  • Corona SDK

Should I submit this as a bug or am I missing something by trying to specify the location on the screen for the tabBar widget by subtracting the height of the widget from the "display.contentHeight" variable? It seems that Corona is returning the correct "Height" but the tabBar is ignoring this. I have worked around this by using the device detection method that Rob Miracle demonstrated in his "Ultimate Config.lua" file and then "translating" the position of the widget so that it ends up on the bottom of the screen in all orientations, but this seems like a lot of work when the "display.content" API's already return the right position (tabBar ignoring it). I even tried swapping the "dispaly.contentHeight" and "display.contentWidth" when the device transitions to landscapeLeft or landscapeRight, and then swapping back on return to "portrait" orientation but this did not work either.

 

I was asked to post my config.lua file which I did promptly. I had already compiled the program without the config.lua file and got the same results as with it.

 

Is anybody else having difficulty placing the Widget 2.0 tabBar on the bottom of the display in all orientations and on all devices? I am new to Corona so if I am missing something, I could sure use some pointers.




[topic_controls]
[/topic_controls]