parent
b51a4dc54e
commit
80c8e56fb0
@ -755,6 +755,10 @@
|
||||
return UIStatusBarStyleDefault;
|
||||
}
|
||||
|
||||
- (BOOL)prefersStatusBarHidden {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
[CDVUserAgentUtil releaseLock:&_userAgentLockToken];
|
||||
@ -1000,13 +1004,26 @@
|
||||
|
||||
// simplified from: http://stackoverflow.com/a/25669695/219684
|
||||
|
||||
UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:frame];
|
||||
UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:[self invertFrameIfNeeded:frame]];
|
||||
bgToolbar.barStyle = UIBarStyleDefault;
|
||||
[bgToolbar setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
|
||||
[self.view addSubview:bgToolbar];
|
||||
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
- (CGRect) invertFrameIfNeeded:(CGRect)rect {
|
||||
// We need to invert since on iOS 7 frames are always in Portrait context
|
||||
if (!IsAtLeastiOSVersion(@"8.0")) {
|
||||
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
|
||||
CGFloat temp = rect.size.width;
|
||||
rect.size.width = rect.size.height;
|
||||
rect.size.height = temp;
|
||||
rect.origin = CGPointZero;
|
||||
}
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
|
||||
#pragma mark CDVScreenOrientationDelegate
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user