AI-generated Key Takeaways
-
Smart Banners automatically adjust to screen width on different devices and orientations, with fixed heights of 50/32 points on iPhones (portrait/landscape) and 90 points on iPads.
-
They display screen-width banner ads, centering smaller image ads and filling the surrounding space.
-
Developers can implement Smart Banners using
kGADAdSizeSmartBannerPortrait
for portrait orkGADAdSizeSmartBannerLandscape
for landscape orientation. -
It is recommended to use adaptive banners instead of Smart Banners for better functionality.
Smart Banners are ad units that render screen-width banner ads on any screen size across different devices in either orientation. Smart Banners detect the width of the device in its current orientation and create the ad view that size.
Smart Banners on iPhones have a height of 50 points in portrait and 32 points in landscape. On iPads, height is 90 points in both portrait and landscape.
When an image ad isn't large enough to take up the entire allotted space, the image will be centered, and the space on either side will be filled in.
To use Smart Banners, just specify kGADAdSizeSmartBannerPortrait
(for portait orientation) or kGADAdSizeSmartBannerLandscape
(for landscape
orientation) for the ad size:
Swift
let bannerView = GAMBannerView(adSize: kGADAdSizeSmartBannerPortrait)
Objective-C
GAMBannerView *bannerView = [[GAMBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];