display.statusBarHeight not scaled

I'm doing a business app where I want the statusBar to be visible for the user.

There is one problem with display.statusBarHeight, it returns the actual pixel height of the status bar without consideration to the scale factor of the display.
When using the value from display.statusBarHeight when my config.lua is set up as letterbox with 320x480px iPhone3 & 4 works but not iPad where the size seems to be double.

When using
local statusBarHeight = display.statusBarHeight;
It works on iPhone3 and 4 but not iPad and Android devices.

On android it works if I use following code:
local statusBarHeight = math.floor(display.statusBarHeight * display.contentScaleY);
This works on Android, iPad and iPhone 3, but not iPhone 4.

I'm using this height to know where the actual UI starts and it's not easy to get it right for all devices.

Should be a quick fix in the SDK.

Hey there,

I'll pass this along but in the meantime you could use the second method while specifying a different setting for the iPhone 4 by checking which device the app is running on.

See here; http://developer.anscamobile.com/reference/index/systemgetinfo

Peach :)

views:2038 update:2012/2/10 9:26:24
corona forums © 2003-2011