views:

69

answers:

1

The HIG (p.47) says that I have to be able to handle the double-height status bar that appears during phone calls or voice recordings.

How exactly do I handle this situation?

I really only have 1 screen where a keyboard with toolbar over it underlaps a textfield when the double-height status bar shows - on other screens things are just a bit scrunched up but useable.

If I could detect that a double-height status bar exists, I could maybe adjust the placement of the textfields or make them temporarily shorter but is it possible to detect when the double-height status bar is there?

EDIT: Maybe if there were a way to get the absolute coordinates of a known thing, like the nav bar, and if it was +20 pixels off, I'd assume that the double-height status bar is present. Thoughts?

And a secondary question, if this (or anything) works, I'd just like to hide the regular status bar using

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]

but I don't want to hide both - basically a lazy way not to have to touch any of my screens - if the double is there, make it a single again by hiding the regular status bar. Will the above code hide both?

A: 

You can monitor these call-backs of UIApplicationDelegate:

  • application:willChangeStatusBarFrame:

  • application:didChangeStatusBarFrame:

And it's easy to test this in the iphone simulator: Hardware->Toggle In-Call Status Bar

Depending on your situation, your views and the things in them can resize automatically to fit the space - check the View Size area of the inspector window in Interface Builder on various objects

Ryan Bavetta
Will this address the situation where the user is on a call or in the process of recording THEN goes into my app? Or will it only monitor a change once in the app?
Matt Winters
ok, maybe you can check UIApplicationStatusBarFrameUserInfoKey
Ryan Bavetta
thanks for pointing me in the right direction. to handle a call origination before entering the app, in some viewDidLoad's I simply check the size of the statusbar frame - if over 20, assume call in progress and size view accordingly. I'm having trouble with the delegate. It fires when the method is put in my AppDelegate but not when in the class that I need it in even if I adopt UIApplicationDelegate in that class so not sure how to handle a call that starts or ends within the each class - what's the bridge from the method in the AppDelegate to the class that I want to change the view in?
Matt Winters
sorted out the delegate issue
Matt Winters