Additional status bar scaling problem (hotspot and call)

Hello,

 

When I connect a device to my iPhone Personal Hotspot, the status bar becomes bigger.

In the test screen I put a Map and Texts

 

1- If the app is already open and I connect a device to the Hotspot. The text is adjusted to the new screen heigh and the Map moves down. So there is an offset between the map and the text. Also a piece of map move out of screen 

 

2- If I connect the Hotspot first and then I open the app. The screen is shifted down and there is a gap between status bar and the text displayed at the top of the app.  When I close the Hotspot the screen moves up but the gap remains, also the Map height is smaller than it should be.

 

I am using iPhone 6s (iOS 9) and Corona 2016.2906 for testing. 

 

How can I handle this two problems? 

 

Images:

First case:

1a - App normal screen

https://postimg.org/image/m2bosww7n/

 

1b- I connect a device to the personal hotspot while the app is open 

https://postimg.org/image/f0dr6pslv/

 

Second case:

2a- First I connect a device to the personal hotspot after that I open the app

https://postimg.org/image/uadmdwo43/

 

2b- I disconnect device to the personal hotspot

https://postimg.org/image/n8forpkib/

 

Code:

main.lua 

 

display.setStatusBar(display.TranslucentStatusBar)

 

local topTitle = display.newText(“Top Top Top Top Top Top”, display.contentCenterX, display.screenOriginY + display.topStatusBarContentHeight + 15  , native.systemFontBold, 30)

local midTitle = display.newText(“Half Half Half Half Half”, display.contentCenterX, display.screenOriginY + display.viewableContentHeight/2  , native.systemFontBold, 30)

local downTitle = display.newText(“Down Down Down Down”, display.contentCenterX, display.screenOriginY + display.viewableContentHeight - 15 , native.systemFontBold, 30)

 

local myMap = native.newMapView( display.contentCenterX,  display.contentCenterY + display.topStatusBarContentHeight/2 , display.viewableContentWidth/2, display.viewableContentHeight - display.topStatusBarContentHeight )

 

 

config.lua 

content =

{

width =360,

height = 640,

scale = “zoomEven”,  --letterbox --zoomEven --zoomStretch --none

},

 

Excuse my bad English.

 

Thanks!

There is an API call to get the status bar height. I’m not sure if the item location services is adding would count, but I would start there and see if you can get the status bar height and adjust your UI accordingly.

https://docs.coronalabs.com/api/library/display/topStatusBarContentHeight.html

Rob

Hi Rob, 

I’ve already tried with display.topStatusBarContentHeight but It hasn’t worked.

Also I’ve tried with “resize” event because if an event notify when the status bar size changes then I could try adjust the UI. But resize event only is trigger when app orientation change from portrait to landscape or vice-versa.

If I hide the statusbar I have problems too because the map is moved although the status bar is hidden.

This behavior also occurs with other objects (example Tableview).

Thanks.

There is an API call to get the status bar height. I’m not sure if the item location services is adding would count, but I would start there and see if you can get the status bar height and adjust your UI accordingly.

https://docs.coronalabs.com/api/library/display/topStatusBarContentHeight.html

Rob

Hi Rob, 

I’ve already tried with display.topStatusBarContentHeight but It hasn’t worked.

Also I’ve tried with “resize” event because if an event notify when the status bar size changes then I could try adjust the UI. But resize event only is trigger when app orientation change from portrait to landscape or vice-versa.

If I hide the statusbar I have problems too because the map is moved although the status bar is hidden.

This behavior also occurs with other objects (example Tableview).

Thanks.