tags:

views:

218

answers:

1

I've been trying to listen for changes in the status bar height – such as when the in-call status bar is shown or hidden, or the same with the internet tethering status bar – by listening for the UIApplicationWillChangeStatusBarFrameNotification notification to be sent.

Fairly straightforward code here...

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(statusBarWillChangeFrame:) 
                                             name:UIApplicationWillChangeStatusBarFrameNotification
                                           object:nil];

But the notification never seems to be sent in that case, either on the Simulator by using the "Toggle In-Call Status Bar" option or on the device when a call ends with the application open. In addition, the similar UIApplicationDelegate method is not called.

According to the documentation,

UIApplicationWillChangeStatusBarFrameNotification

Posted when the application is about to change the frame of the status bar.

The userInfo dictionary contains an NSValue object that encapsulates a CGRect structure expressing the location and size of the new status bar frame. Use UIApplicationStatusBarFrameUserInfoKey to access this value.

Can anyone explain why this notification is not being sent in response to the in-call status bar being shown or hidden? According to the documentation, it should be.

+1  A: 

It appears as if this is an active SDK bug. So much for that.

See http://openradar.appspot.com/6475681 and http://openradar.appspot.com/7080782.

Sbrocket