Question

I noticed my iPhone app does not behave the same between the iOS7 version and the previous iOS version. Of course there are the obvious difference (the styling), but i am talking about coded logic that depends on the status bar being visible or not.

In previous versions, when i calculate heights and vertical locations (for various layout/position purposes) i had to take the status bar (which has a height of 20 "pixels") into account. For example, since my app has the status displayed, i had to take into account 20 pixels (because Y-position of 0 was not the very top of the screen, but rather the 21st pixel location (below the status bar).

But now, in iOS7, it seems that this is no longer the case (Y-position of 0 is the top of the status bar).

I hope I'm explaining this clearly. And i hope somebody can direct me to better understanding what is going on here.

Was it helpful?

Solution

In previous version of iOS we could not change much in status bar other than its colour, and 20 points space were reserved for the status bar in your View Hierarchy. In iOS7, status bar becomes transparent and you can use the 20 points space now.

But if you use Navigation Controller, you do not have to worry much about the issue. When a UINavigationController is present, the UINavigationBar will automatically be placed below the status bar. In this case, the appearance of status bar will solely depend on the navigation bar below it and if you want to change anything in status bar you have to change in navigation bar as well.

You can read more in this official documentation
or
in this blog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top