The handset status bar overlaps after the inapppbrowser or camera is closed

I use the cordova status bar plugin, it works fine until I open inappbrowser or open the camera, after which it overlays the application.

I tried the following methods: -

<preference name="fullscreen" value="false" />

 Add 20px margin, but that only works when the above scenario is encountered, else it shows blank 20px space (Used with cordova plugin)
+5
source share
3 answers

Try the following to restore hidden overlap:

StatusBar.overlaysWebView(true);
StatusBar.overlaysWebView(false);
+1
source

I solved this using this code after closing the camera.

    $cordovaStatusbar.overlaysWebView(true);
    $cordovaStatusbar.overlaysWebView(false);

Btw, I am using ngCordova.

0
source

JavaScript overlaysWebView true false , , setNeedsStatusBarAppearanceUpdate , .

CDVCamera.m https://github.com/apache/cordova-plugin-camera/blob/master/src/ios/CDVCamera.m#L751

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    [self setNeedsStatusBarAppearanceUpdate];
}

Currently implemented only viewWillAppear.


By the way: maybe someone knows why the hidden transition of the status bar works with the following code (in the method viewWillAppear):

SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
if ([self respondsToSelector:sel]) {
    [self performSelector:sel withObject:nil afterDelay:0];
}

but not with the following:

[self setNeedsStatusBarAppearanceUpdate];

And in viewWillDisappearit only works if afterDelay is not enabled with executeSelector or called [self setNeedsStatusBarAppearanceUpdate];.

0
source

Source: https://habr.com/ru/post/1671117/


All Articles