Skip to content

Commit

Permalink
fix(iOS): Delay resizeWebView on viewWillAppear for correct statusbar…
Browse files Browse the repository at this point in the history
… height (#157)
  • Loading branch information
MrBullfinsh authored and jcesarmobile committed Oct 20, 2019
1 parent 5f6614c commit 13645b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ios/CDVStatusBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ - (void)observeValueForKeyPath:(NSString*)keyPath ofObject:(id)object change:(NS

-(void)cordovaViewWillAppear:(NSNotification*)notification
{
[self resizeWebView];
//add a small delay ( 0.1 seconds ) or statusbar size will be wrong
__weak CDVStatusBar* weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[weakSelf resizeWebView];
});
}

-(void)statusBarDidChangeFrame:(NSNotification*)notification
Expand Down

0 comments on commit 13645b9

Please sign in to comment.