智慧型橫幅廣告
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
導入智慧型橫幅廣告單元,可在螢幕大小不同的裝置上,以直向或橫向顯示與畫面同寬的橫幅廣告。智慧型橫幅廣告會偵測裝置在目前螢幕方向的寬度,並建立該大小的廣告檢視區塊。
在 iPhone 上,智慧型橫幅廣告處於直向模式時的高度為 50 點,橫向模式則是 32 點。若是在 iPad 上,無論直向或橫向模式,高度皆為 90 點。
如果圖像廣告不夠大,無法完整覆蓋分配到的版面,系統會將圖片置中,並填滿左右兩側的空間。

若要使用智慧型橫幅廣告,請直接用 kGADAdSizeSmartBannerPortrait (直向模式) 或 kGADAdSizeSmartBannerLandscape (橫向模式) 來指定廣告尺寸:
Swift
let bannerView = GAMBannerView(adSize: kGADAdSizeSmartBannerPortrait)
Objective-C
GAMBannerView *bannerView = [[GAMBannerView alloc]
initWithAdSize:kGADAdSizeSmartBannerPortrait];
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-10-23 (世界標準時間)。
[null,null,["上次更新時間:2026-10-23 (世界標準時間)。"],[],["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"]]