智能横幅广告
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
智能横幅是一种广告单元,可在各种设备上展示与屏幕等宽的横幅广告,而无论屏幕大小或方向如何。智能横幅可检测设备在当前屏幕方向下的宽度,并以此尺寸为宽度创建广告视图。
在 iPhone 上,智能横幅在纵向屏幕下高度为 50 点,在横向屏幕下则为 32 点。在 iPad 上,无论屏幕为纵向还是横向,智能横幅的高度均为 90 点。
如果图片广告未能完全填满预留空间,系统会将图片居中放置,并用背景填充两侧的空白区域。

若要使用智能横幅,只需为广告尺寸指定 kGADAdSizeSmartBannerPortrait(适用于纵向屏幕)或 kGADAdSizeSmartBannerLandscape(适用于横向屏幕)即可:
Swift
let bannerView = GAMBannerView(adSize: kGADAdSizeSmartBannerPortrait)
Objective-C
GAMBannerView *bannerView = [[GAMBannerView alloc]
initWithAdSize:kGADAdSizeSmartBannerPortrait];
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-04-07。
[null,null,["最后更新时间 (UTC):2026-04-07。"],[],["Smart Banners display screen-width ads, adapting to any device size and orientation. They automatically detect device width and create appropriately sized ad views. On iPhones, banner heights are 50 points in portrait and 32 in landscape; on iPads, they are 90 points in both. Smaller image ads are centered, with surrounding space filled in. To implement, set the ad size to `kGADAdSizeSmartBannerPortrait` or `kGADAdSizeSmartBannerLandscape`. The newer adaptive banners are an alternative.\n"]]