智慧型橫幅廣告
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
智慧型橫幅廣告可在各種不同螢幕大小的裝置上,以直向/橫向顯示與畫面同寬的橫幅廣告。智慧型橫幅廣告會偵測裝置在目前螢幕方向的寬度,並建立該大小的廣告檢視區塊。
智慧型橫幅廣告會導入三種廣告高度:
廣告高度 |
螢幕高度 |
32 dp |
≤ 400 dp |
50 dp |
> 400 dp 且 ≤ 720 dp |
90 dp |
> 720 dp |
一般來說,手機上的智慧型橫幅廣告在直向模式下高度為 50 dp,在橫向模式下為 32 dp。在平板電腦上,無論是直向或橫向,廣告高度通常為 90 dp。
如果圖像廣告不夠大,無法佔滿整個分配的空間,系統會將圖片置中,並填滿兩側的空間。

如要使用智慧型橫幅廣告,請在建立 BannerView
時指定 AdSize.SmartBanner
做為廣告大小。例如:
// Create a Smart Banner at the top of the screen.
BannerView bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-28 (世界標準時間)。
[null,null,["上次更新時間:2025-08-28 (世界標準時間)。"],[[["\u003cp\u003eSmart Banners are responsive ad units that adjust their size to fit the screen width of various devices and orientations.\u003c/p\u003e\n"],["\u003cp\u003eThey utilize three ad heights (32 dp, 50 dp, 90 dp) based on the screen height of the device.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should use \u003ccode\u003eAdSize.SmartBanner\u003c/code\u003e when creating a \u003ccode\u003eBannerView\u003c/code\u003e to implement Smart Banners in their apps.\u003c/p\u003e\n"],["\u003cp\u003eConsider using adaptive banners as a newer alternative to Smart Banners for improved ad performance and flexibility.\u003c/p\u003e\n"]]],["Smart Banners render screen-width ads, adapting to any device size and orientation. They detect device width and create an ad view accordingly, using heights of 32 dp (≤ 400 dp screen height), 50 dp (\u003e 400 dp and ≤ 720 dp), or 90 dp (\u003e 720 dp). Image ads are centered when they don't fill the space. To implement, specify `AdSize.SmartBanner` when creating a `BannerView`, such as `new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top)`.\n"],null,["Select platform: [Android](/admob/android/banner/smart \"View this page for the Android platform docs.\") [iOS](/admob/ios/banner/smart \"View this page for the iOS platform docs.\") [Unity](/admob/unity/banner/smart \"View this page for the Unity platform docs.\")\n\n\u003cbr /\u003e\n\n| Try the newer [adaptive banners](/admob/unity/banner/anchored-adaptive) instead.\n\nSmart Banners are ad units that render screen-width banner ads on any screen\nsize across different devices in either orientation. Smart Banners detect the\nwidth of the device in its current orientation and create the ad view that size.\n\nThree ad heights are implemented in smart banners:\n\n| Ad height | Screen height |\n|-----------|------------------------|\n| 32 dp | ≤ 400 dp |\n| 50 dp | \\\u003e 400 dp and ≤ 720 dp |\n| 90 dp | \\\u003e 720 dp |\n\nTypically, Smart Banners on phones have a height of 50 dp in portrait and 32 dp\nin landscape. On tablets, height is normally 90 dp in both orientations.\n\nWhen an image ad isn't large enough to take up the entire allotted space, the\nimage will be centered, and the space on either side will be filled in.\n\nTo use Smart Banners, specify the `AdSize.SmartBanner` for the ad size when\ncreating a `BannerView`. For example: \n\n```c#\n// Create a Smart Banner at the top of the screen.\nBannerView bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);\n```"]]