Resize for in-call status bar?

Steven Fisher picture Steven Fisher · Jul 11, 2009 · Viewed 29.1k times · Source

How can I make my view resize in response to the in-call status bar from my nib?

I figured it would just be setting the resize properties, but they're not enabled for the root UIView.

(I think my main problem here is I don't know what any of this is called; I can't find any reference to the in-call status bar in any of the documentation except where it talks about the simulator menu command.)

Answer

Santhos Ramalingam picture Santhos Ramalingam · Nov 30, 2011

iOS will invoke your viewController's viewWillLayoutSubviews method whenever there is a change in status bar. You can override that and adjust your subviews according to the new bounds.

- (void)viewWillLayoutSubviews {
    // Your adjustments accd to 
    // viewController.bounds

    [super viewWillLayoutSubviews];
}