Apple introduced universal storyboard for developing one interface that works on all iPhone sizes and iPad sizes.
Can Admob banner ads support universal storyboard? iPhone 6 (plus)?
Admob Banner ad size, which is not currently showing sizes for iPhone 6 (plus).
Admob quick start guide, which used a fixed 320*50 frame size. How can I add support for iPad and 4.7"/5.5" displays?
Here's the universal storyboard guide from [Raywenderlich], or [Apple] ->I can't post the links due to lack of reputations :(
Thanks!
There are two moments you should rely on:
kGADAdSizeSmartBannerPortrait
or kGADAdSizeSmartBannerLandscape
). Banner with required size will be downloaded automatically (its a main pros of smart banners usage). As said in google docs: In portrait mode on phones, this will make the ad view either 320x50 or 360x50 in size, depending on whether the device is widescreen. In landscape mode on phones, this will make the ad view anywhere from 480x32 to 682x32 depending on the height of the device.
When an image ad won't take up the entire allotted space for the banner, we'll center the image and use a hexagonal textile filler (see image) to fill up the remaining space. Note that AdSense backfill ads will be centered and have "transparent" filler.
so you shouldn't worry about that.
bannerView.frame.size.height
value (better and flexible) To change a height value for a banner in Storyboard view you should:
90 px
height constraint for w:Any h:Any
w:Compact h:Regular
(to select all iPhones)Cmd+Delete
. That will disable constraint for current size class50 px
constraint At this point in time, I don't think there's really a decent solution here. It's speculation on my part, but I think the real issue is that Google just doesn't yet have the correctly-sized creatives to serve up 6 and 6Plus ads.
That said, I'm using the following code, in the hopes that, in the future, the "kGADAdSizeSmartBannerPortrait" size will cause adMob to serve up content that's sized properly for the 6 and 6Plus. This code currently results in a 320x50 banner being served to my apps when running on the 6 and 6Plus. (Note also that my app is portrait-only, but it wouldn't be too much trouble to add landscape support to this.)
// Create adMob ad View (note the use of various macros to detect device)
if (isiPad) {
_adMobView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeFullBanner];
}
else if (isiPhone6) {
_adMobView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
}
else if (isiPhone6Plus) {
_adMobView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
}
else {
// boring old iPhones and iPod touches
_adMobView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With