I'm a little annoyed. I have an application with a status bar visible in the main window. Since I would like to adjust my views and their frame sizes dynamically (perhaps the status bar takes 40 pixels during a phone call, for example).
I can do one of two things:
[[UIScreen mainScreen] bounds]; [[UIScreen mainScreen] applicationFrame];
In fact, it annoys these two outputs with two different sets of values, each of which is equally useless.
bounds will output: {{0, 0}, {320, 480}} , and applicationFrame output {{0, 20}, {320, 460}}
As you can see, bounds gives the correct y origin (0 starts to the right of the status bar), but then gives a height of 480, which is incorrect. It should be 460 because the status bar is visible. Then we have an applicationFrame that starts 20 pixels below the status bar (so there is a cap), but then gives the correct height. But this is not very useful when in any case it pushes 20 pixels.
Any help?
uiview frame uiapplication
runmad Mar 01 '11 at 5:21 2011-03-01 05:21
source share