Hi guys in my app I use the following config:
. . . content = { width = 320, height = 480, scale = "letterbox", fps = 60, imageSuffix = { ["@2x"] = 1.5, --\<---- changed from 2 to 1.5 ["@4x"] = 3, --\<---- changed from 4 to 3 }, }, . . .
I also hide the notification bar using:
display.setStatusBar( display.HiddenStatusBar )
and finally I create my background by doing something like:
local bg = display.newRect( display.contentCenterX, display.contentCenterY, display.actualContentWidth, display.actualContentHeight)
All this works well and the many test projects are done.
The problem is that on Android the navigation bar is very annoying so I hide it with:
local function onResize( event ) if (system.getInfo("androidApiLevel") \>= 19) then native.setProperty("androidSystemUiVisibility", "immersiveSticky") else native.setProperty("androidSystemUiVisibility", "lowProfile") end end onResize() Runtime:addEventListener( "resize", onResize )
And here the problem is created. Apparently display.actualContentWidth and display.actualContentHeight refer to the entire screen without bar. and when I hide the bar everything is centered, leaving small black edges above and below the screen.
Is there a way to know the new dimensions? something to solve this?