Skip to content

Instantly share code, notes, and snippets.

@florentmorin
Created November 4, 2017 11:30
Show Gist options
  • Save florentmorin/a1612a4cfee8043d9c6039a99ec3a109 to your computer and use it in GitHub Desktop.
Save florentmorin/a1612a4cfee8043d9c6039a99ec3a109 to your computer and use it in GitHub Desktop.
Cordova Main View Controller for iPhone X
- (void)viewWillAppear:(BOOL)animated
{
// View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView),
// you can do so here.
[super viewWillAppear:animated];
// Fix for iOS 11 status bar UI
if (@available(iOS 11.0, *)) {
self.view.backgroundColor = [UIColor orangeColor];
[self.webView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentAlways];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment