0

I am having some problems with my app after a phone call. The app hides the status bar.

Here's the scenario:

  1. Phone call in process

  2. Open app

  3. End phone call

Depends on view (sometimes it even acts differently on the same view!) the app no longer hides the status bar. It looks like the view starts just under it.

I tried to solve the problem with this code:

- (void)application:(UIApplication *)application didChangeStatusBarFrame:(CGRect)oldStatusBarFrame
{
    UIView *topView = [[[[UIApplication sharedApplication] keyWindow] subviews] lastObject];
    if (oldStatusBarFrame.size.height == 40) 
    {
        topView.frame = CGRectMake(topView.frame.origin.x, -20, topView.frame.size.width, topView.frame.size.height);
    }
}

Sometimes it does the trick and sometimes not...

Please help me figure what is going on...

rmaddy
  • 314,917
  • 42
  • 532
  • 579
YogevSitton
  • 10,068
  • 11
  • 62
  • 95
  • See http://stackoverflow.com/questions/5486491/how-in-call-status-bar-impacts-uiviewcontrollers-view-size-and-how-to-handle - set the autoResizingMask's. – petert Apr 28 '14 at 13:57

1 Answers1

0

The height of the view when the In-call status bar is toggled depends on the way it's anchored.

Play around with the autoResizingMask of the UIView to control whether the view should move down or resize when the in-call status bar shows up.

These two properties,

UIViewAutoresizingFlexibleTopMargin
UIViewAutoresizingFlexibleHeight  

will help you. The first one pushes the view down, the second one changes the size.

This question is also answered HERE on stackoverflow

Community
  • 1
  • 1
iAhmed
  • 6,556
  • 2
  • 25
  • 31