Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Commit

Permalink
Add space for non-overlapping bottom banners on iPhone X (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBuchalik authored and ratson committed Mar 23, 2018
1 parent 32b671b commit a4a302b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ios/CDVAdMob.m
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ - (void) __createBanner {
NSLog(@"__createBanner");

// set background color to black
//self.webView.superview.backgroundColor = [UIColor blackColor];
self.webView.superview.backgroundColor = [UIColor blackColor];
//self.webView.superview.tintColor = [UIColor whiteColor];

if (!self.bannerView){
Expand Down Expand Up @@ -711,6 +711,12 @@ - (void)resizeViews {
bf.origin.y = wf.size.height - bf.size.height; // banner is subview of webview
} else {
bf.origin.y = pr.size.height - bf.size.height;

if (@available(iOS 11.0, *)) {
bf.origin.y -= parentView.safeAreaInsets.bottom;
bf.size.width = wf.size.width - parentView.safeAreaInsets.left - parentView.safeAreaInsets.right;
wf.size.height -= parentView.safeAreaInsets.bottom;
}
}
}

Expand Down

0 comments on commit a4a302b

Please sign in to comment.