mirror of
https://github.com/apache/cordova-plugin-statusbar.git
synced 2025-01-31 18:52:53 +08:00
parent
3dd497135f
commit
aebe3c60bf
@ -30,6 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@property (atomic, assign) BOOL statusBarOverlaysWebView;
|
@property (atomic, assign) BOOL statusBarOverlaysWebView;
|
||||||
|
@property (atomic, assign) BOOL statusBarVisible;
|
||||||
|
|
||||||
- (void) overlaysWebView:(CDVInvokedUrlCommand*)command;
|
- (void) overlaysWebView:(CDVInvokedUrlCommand*)command;
|
||||||
|
|
||||||
|
@ -146,6 +146,8 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
|||||||
[self.viewController.view sendSubviewToBack:fakeScrollView]; // Send it to the very back of the view heirarchy
|
[self.viewController.view sendSubviewToBack:fakeScrollView]; // Send it to the very back of the view heirarchy
|
||||||
fakeScrollView.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height * 2.0f); // Make the scroll view longer than the screen itself
|
fakeScrollView.contentSize = CGSizeMake(UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height * 2.0f); // Make the scroll view longer than the screen itself
|
||||||
fakeScrollView.contentOffset = CGPointMake(0.0f, UIScreen.mainScreen.bounds.size.height); // Scroll down so a tap will take scroll view back to the top
|
fakeScrollView.contentOffset = CGPointMake(0.0f, UIScreen.mainScreen.bounds.size.height); // Scroll down so a tap will take scroll view back to the top
|
||||||
|
|
||||||
|
_statusBarVisible = ![UIApplication sharedApplication].isStatusBarHidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)onReset {
|
- (void)onReset {
|
||||||
@ -379,6 +381,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
|||||||
|
|
||||||
- (void) hide:(CDVInvokedUrlCommand*)command
|
- (void) hide:(CDVInvokedUrlCommand*)command
|
||||||
{
|
{
|
||||||
|
_statusBarVisible = NO;
|
||||||
UIApplication* app = [UIApplication sharedApplication];
|
UIApplication* app = [UIApplication sharedApplication];
|
||||||
|
|
||||||
if (!app.isStatusBarHidden)
|
if (!app.isStatusBarHidden)
|
||||||
@ -411,6 +414,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
|||||||
|
|
||||||
- (void) show:(CDVInvokedUrlCommand*)command
|
- (void) show:(CDVInvokedUrlCommand*)command
|
||||||
{
|
{
|
||||||
|
_statusBarVisible = YES;
|
||||||
UIApplication* app = [UIApplication sharedApplication];
|
UIApplication* app = [UIApplication sharedApplication];
|
||||||
|
|
||||||
if (app.isStatusBarHidden)
|
if (app.isStatusBarHidden)
|
||||||
@ -463,8 +467,10 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
|
|||||||
CGFloat height = statusBarFrame.size.height;
|
CGFloat height = statusBarFrame.size.height;
|
||||||
|
|
||||||
if (!self.statusBarOverlaysWebView) {
|
if (!self.statusBarOverlaysWebView) {
|
||||||
// CB-10158 If a full screen video is playing the status bar height will be 0, set it to 20
|
if (_statusBarVisible) {
|
||||||
|
// CB-10158 If a full screen video is playing the status bar height will be 0, set it to 20 if _statusBarVisible
|
||||||
frame.origin.y = height > 0 ? height: 20;
|
frame.origin.y = height > 0 ? height: 20;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Even if overlay is used, we want to handle in-call/recording/hotspot larger status bar
|
// Even if overlay is used, we want to handle in-call/recording/hotspot larger status bar
|
||||||
frame.origin.y = height >= 20 ? height - 20 : 0;
|
frame.origin.y = height >= 20 ? height - 20 : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user