I have the following code to show a modal view that is added as a subtitle of my tabBarController. However, despite using the autoresizingMask property, which allows, when an incoming cellular call terminates my application and shows a green status bar at the top, I find after this event the whole view is shifted 20 pixels down
- (void) showLogin:(UIView*) modalView
{
CGPoint middleCenter = CGPointMake(160, 226);
CGSize offSize = [UIScreen mainScreen].bounds.size;
CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, -210);
modalView.center = offScreenCenter;
modalView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self.tabBarController.view addSubview:modalView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.4];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
modalView.center = middleCenter;
[UIView commitAnimations];
}
How to solve this? Thanks
source
share