mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-03-14 18:51:03 +08:00
CB-8720 Fix status bar position when app started upside down on iOS 7. This closes #44
This commit is contained in:
parent
3e9ce84a56
commit
d853f828d6
@ -180,6 +180,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
||||
- (void) initializeStatusBarBackgroundView
|
||||
{
|
||||
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
|
||||
|
||||
if ([[UIApplication sharedApplication]statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown &&
|
||||
statusBarFrame.size.height + statusBarFrame.origin.y == [[UIScreen mainScreen] bounds].size.height) {
|
||||
|
||||
// When started in upside-down orientation on iOS 7, status bar will be bound to lower edge of the
|
||||
// screen (statusBarFrame.origin.y will be somewhere around screen height). In this case we need to
|
||||
// correct frame's coordinates
|
||||
statusBarFrame.origin.y = 0;
|
||||
}
|
||||
|
||||
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame orientation:self.viewController.interfaceOrientation];
|
||||
|
||||
_statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];
|
||||
|
Loading…
x
Reference in New Issue
Block a user