スマートバナー
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
プラットフォームを選択:
Android
iOS
Unity
スマートバナーは、あらゆる画面サイズのデバイスで、画面をどの向きにしていても横幅いっぱいに広告を表示できる広告ユニットです。デバイスの向きに応じて画面の横幅が検知され、そのサイズの広告ビューが作成されます。
スマートバナーで表示される広告の高さは、次の 3 つのいずれかになります。
広告の高さ |
画面の高さ |
32 dp |
400 dp 以下 |
50 dp |
400 dp 超、720 dp 以下 |
90 dp |
720 dp 超 |
通常では、スマートフォン向けのスマートバナーの高さは縦向きで 50 dp、横向きで 32 dp になります。タブレットの場合、通常ではどちらの向きでも高さが 90 dp になります。
イメージ広告を割り当てられたスペース全体に表示すると余白が生じる場合は、画像が中央寄せになり、両側のスペースは塗りつぶされます。

スマートバナーを XML で使用するには、定数値 SMART_BANNER
を広告サイズとして指定し、AdView
の幅を match_parent
に設定します。例:
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
</com.google.android.gms.ads.AdView>
スマートバナーをプログラムで作成する場合は、次のように AdSize.SMART_BANNER
を広告サイズとして使用します。
Java
AdView adView = new AdView(this);
adView.setAdSize(AdSize.SMART_BANNER);
Kotlin
val adView = AdView(this)
adView.adSize = AdSize.SMART_BANNER
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eSmart Banners are responsive ad units that adjust their size to fit the width of the device screen across various devices and orientations.\u003c/p\u003e\n"],["\u003cp\u003eThey automatically determine the appropriate ad height (32 dp, 50 dp, or 90 dp) based on the screen height of the device.\u003c/p\u003e\n"],["\u003cp\u003eIt is recommended to use the newer adaptive banners for better performance and user experience.\u003c/p\u003e\n"],["\u003cp\u003eSmart Banners can be easily implemented in XML by setting the \u003ccode\u003eadSize\u003c/code\u003e to \u003ccode\u003eSMART_BANNER\u003c/code\u003e and the \u003ccode\u003eAdView\u003c/code\u003e width to \u003ccode\u003ematch_parent\u003c/code\u003e, or programmatically by using \u003ccode\u003eAdSize.SMART_BANNER\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Smart Banners\n\nSelect 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/android/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 in XML, specify the constant `SMART_BANNER` for the ad\nsize and set the width of the `AdView` to `match_parent`. For example: \n\n```scdoc\n\u003ccom.google.android.gms.ads.AdView\n xmlns:ads=\"http://schemas.android.com/apk/res-auto\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n ads:adSize=\"SMART_BANNER\"\n ads:adUnitId=\"ca-app-pub-3940256099942544/6300978111\"\u003e\n\u003c/com.google.android.gms.ads.AdView\u003e\n```\n\nTo create a Smart Banner programmatically, use `AdSize.SMART_BANNER` as the ad\nsize: \n\n### Java\n\n```java\nAdView adView = new AdView(this);\nadView.setAdSize(AdSize.SMART_BANNER);\n```\n\n### Kotlin\n\n```kotlin\nval adView = AdView(this)\nadView.adSize = AdSize.SMART_BANNER\n```"]]