In iOS 7 the UIStatusBar
has been designed in a way that it merges with the view like this:
As using presentViewController:animated:completion:
messed-up the window.rootViewController.view
, I had to find a different approach to this issue. I finally got it to work with modals and rotations by subclassing the UIView of my rootViewController.
.h
@interface RootView : UIView
@end
.m
@implementation RootView
-(void)setFrame:(CGRect)frame
{
if (self.superview && self.superview != self.window)
{
frame = self.superview.bounds;
frame.origin.y += 20.f;
frame.size.height -= 20.f;
}
else
{
frame = [UIScreen mainScreen].applicationFrame;
}
[super setFrame:frame];
}
- (void)layoutSubviews
{
self.frame = self.frame;
[super layoutSubviews];
}
@end
You now have a strong workaround for iOS7 animations.