Wenn Sie sich mit anderen Nutzern über unsere Produkte austauschen und Feedback geben möchten, treten Sie dem offiziellen Ad Manager-Discord-Kanal auf dem Server der Google Advertising and Measurement Community bei.
Bei adaptiven Bannern können Sie die Breite einer Anzeige festlegen, um die optimale Anzeigengröße zu ermitteln. Mit adaptiven Bannern wird die Anzeigengröße für jedes Gerät optimiert. So können Sie die Leistung maximieren. Dieser Ansatz bietet Möglichkeiten zur Leistungssteigerung.
Im Vergleich zu verankerten adaptiven Bannern sind adaptive Inline-Banner größer und höher. Außerdem wird bei ihnen eine variable statt einer festen Höhe verwendet. Adaptive Inline-Banner haben eine variable Höhe und können den gesamten Bildschirm oder eine von Ihnen angegebene maximale Höhe einnehmen.
Adaptive Inline-Banner werden in scrollbarem Content platziert, z. B.:
Hinweis
Bevor Sie fortfahren, benötigen Sie Folgendes:
Sie haben den Startleitfaden Banneranzeigen durchgearbeitet.
Adaptive Banner implementieren
Im Gegensatz zu adaptiven Ankerbannern werden adaptive Inline-Banner mit einer adaptiven Inline-Bannergröße geladen. So erstellen Sie eine Inline-Anzeigengröße, die sich an den verfügbaren Platz anpasst:
Rufen Sie die Breite des verwendeten Geräts ab oder legen Sie eine eigene Breite fest, wenn Sie nicht die volle Breite des Bildschirms verwenden möchten.
Verwenden Sie die entsprechenden statischen Methoden in der Klasse für Anzeigengrößen, z. B. GADCurrentOrientationInlineBannerAdSizeWithWidth(CGFloat width), um ein Objekt für die adaptive Inline-Anzeigengröße für die ausgewählte Ausrichtung abzurufen.
Swift
// Step 1: Create an inline adaptive banner ad size. This size is used to// request your adaptive banner. You can pass in the width of the device, or// set your own width. This example sets a static width.letadSize=GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(320)// Step 2: Create banner with the inline size and set ad unit ID.letbannerView=GAMBannerView(adSize:adSize)bannerView.adUnitID="AD_UNIT_ID"bannerView.rootViewController=self// For Ad Manager, the `adSize` property is used for the adaptive banner ad// size. The `validAdSizes` property is used as normal for the supported// reservation sizes for the ad placement.bannerView.validAdSizes=[NSValueFromGADAdSize(AdSizeBanner)]// Step 3: Load an ad.letrequest=AdManagerRequest()bannerView.load(request)// TODO: Insert banner view in table view or scroll view, etc.
Objective-C
// Step 1: Create an inline adaptive banner ad size. This size is used to// request your adaptive banner. You can pass in the width of the device, or set// your own width. This example sets a static width.GADAdSizeadSize=GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(320);// Step 2: Create banner with the inline size and set ad unit ID.GAMBannerViewbannerView=[[GAMBannerViewalloc]initWithAdSize:adSize];bannerView.adUnitID=@"AD_UNIT_ID";bannerView.rootViewController=self;// For Ad Manager, the adSize property is used for the adaptive banner ad size.// The validAdSizes property is used as normal for the supported reservation// sizes for the ad placement. This is optional and only needed if you wish to// support reservation ad sizes.bannerView.validAdSizes=@[NSValueFromGADAdSize(GADAdSizeBanner)];// Step 3: Load an ad.GAMRequest*request=[GAMRequestrequest];[bannerViewloadRequest:request];// TODO: Insert banner view in table view or scroll view, etc.
Beachten Sie beim Implementieren adaptiver Banner in Ihrer App die folgenden Punkte:
Die adaptiven Inline-Bannergrößen funktionieren am besten, wenn die gesamte verfügbare Breite genutzt wird. In den meisten Fällen entspricht sie der vollen Breite des verwendeten Gerätedisplays oder der vollen Breite des übergeordneten Inhalts des Banners. Sie müssen die Breite der Ansicht, die in der Anzeige platziert werden soll, die Gerätebreite, die Breite des übergeordneten Inhalts und die anwendbaren Safe Areas kennen.
Möglicherweise müssen Sie Werbebuchungen aktualisieren oder neue erstellen, um adaptive Größen zu verwenden. Weitere Informationen
Größe von adaptiven Inline-Bannern ausrichten
Wenn Sie ein adaptives Inlinebanner für eine bestimmte Ausrichtung vorab laden möchten, verwenden Sie die folgenden Methoden:
Wenn Ihre App sowohl das Hoch- als auch das Querformat unterstützt und Sie ein adaptives Banner in der aktuellen Ausrichtung vorab laden möchten, verwenden Sie GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(CGFloat width).
Mit dieser Methode wird eine Anzeige in der aktuellen Ausrichtung geladen.
[null,null,["Zuletzt aktualisiert: 2025-09-02 (UTC)."],[[["\u003cp\u003eAdaptive banners optimize ad sizes for each device to maximize performance and improve user experience.\u003c/p\u003e\n"],["\u003cp\u003eInline adaptive banners are designed for scrolling content and can be customized with a specific width and maximum height.\u003c/p\u003e\n"],["\u003cp\u003eTo implement inline adaptive banners, use the provided SDK methods to create an ad size, initialize a banner view, and load an ad request.\u003c/p\u003e\n"],["\u003cp\u003eYou can use specific methods to preload an inline adaptive banner for a particular orientation (portrait or landscape).\u003c/p\u003e\n"],["\u003cp\u003eGoogle provides sample applications on GitHub to demonstrate the implementation of inline adaptive banners in both Swift and Objective-C.\u003c/p\u003e\n"]]],["Inline adaptive banners, designed for scrolling content, adjust their size based on device width, optimizing performance. Implementation involves obtaining device width or setting a custom width, then using `GADCurrentOrientationInlineBannerAdSizeWithWidth` or `GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight` to create the ad size. These banners load using the specified size, and `validAdSizes` supports reservation sizes. For orientation-specific preloading, use `GADPortraitInlineAdaptiveBannerAdSizeWithWidth` or `GADLandscapeInlineAdaptiveBannerAdSizeWithWidth`. `GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight` enables limiting banner height.\n"],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/banner/inline-adaptive \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/banner/inline-adaptive \"View this page for the iOS platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/banner/inline-adaptive \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nAdaptive banners let you specify the width of an ad to determine the optimal\nad size. Adaptive banners also maximize performance by optimizing the ad size\nfor each device. This approach results in opportunities for\nimproved performance.\n\nCompared to anchored adaptive banners, inline adaptive banners are larger,\ntaller, and use variable instead of fixed heights. Inline adaptive banners are\nof variable height, and might encompass the entire screen or a maximum height\nthat you specify.\n\nYou place inline adaptive banners in scrolling content, for example:\n\nBefore you begin\n\nBefore continuing, make sure you have the following:\n\n- Completed the getting started guide, [Banner Ads](/ad-manager/mobile-ads-sdk/ios/banner).\n\nImplement adaptive banners\n\nUnlike anchored adaptive banners, inline adapter banners load using an inline\nadaptive banner size. To create an inline adaptive ad size, complete the\nfollowing:\n\n1. Get the width of the device in use, or set your own width if you don't want\n to use the full width of the screen.\n\n2. Use the appropriate static methods on the ad size class, such as\n\n `GADCurrentOrientationInlineBannerAdSizeWithWidth(CGFloat width)`\n\n to get an inline adaptive ad size object for the chosen orientation.\n\n \u003cbr /\u003e\n\n Swift \n\n // Step 1: Create an inline adaptive banner ad size. This size is used to\n // request your adaptive banner. You can pass in the width of the device, or\n // set your own width. This example sets a static width.\n let adSize = GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(320)\n // Step 2: Create banner with the inline size and set ad unit ID.\n let bannerView = GAMBannerView(adSize: adSize)\n bannerView.adUnitID = \"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\"\n bannerView.rootViewController = self\n\n // For Ad Manager, the `adSize` property is used for the adaptive banner ad\n // size. The `validAdSizes` property is used as normal for the supported\n // reservation sizes for the ad placement.\n bannerView.validAdSizes = [NSValueFromGADAdSize(AdSizeBanner)]\n\n // Step 3: Load an ad.\n let request = AdManagerRequest()\n bannerView.load(request)\n // TODO: Insert banner view in table view or scroll view, etc.\n\n Objective-C \n\n // Step 1: Create an inline adaptive banner ad size. This size is used to\n // request your adaptive banner. You can pass in the width of the device, or set\n // your own width. This example sets a static width.\n GADAdSize adSize = GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(320);\n // Step 2: Create banner with the inline size and set ad unit ID.\n GAMBannerView bannerView = [[GAMBannerView alloc] initWithAdSize:adSize];\n bannerView.adUnitID = @\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\";\n bannerView.rootViewController = self;\n\n // For Ad Manager, the adSize property is used for the adaptive banner ad size.\n // The validAdSizes property is used as normal for the supported reservation\n // sizes for the ad placement. This is optional and only needed if you wish to\n // support reservation ad sizes.\n bannerView.validAdSizes = @[ NSValueFromGADAdSize(GADAdSizeBanner) ];\n\n // Step 3: Load an ad.\n GAMRequest *request = [GAMRequest request];\n [bannerView loadRequest:request];\n // TODO: Insert banner view in table view or scroll view, etc.\n\n | **Important:** Ad Manager reservation ad sizes can be served in the same ad slot as adaptive banner sized ads. In order to use adaptive banners with Ad Manager reservation ads in the same ad slot, two changes need to be made. First, set `adSize` to the adaptive size. Second, set `validAdSizes` to an array of sizes, containing all sizes of reservation ads you wish to serve in the adaptive ad slot.\n\n When implementing adaptive banners in your app, note these points:\n - The inline adaptive banner sizes work best when using the full available width. In most cases, this size is the full width of the device screen in use, or the full width of the banner's parent content. You must know the width of the view to place in the ad, the device width, the parent content width, and applicable safe areas.\n\n \u003c!-- --\u003e\n\n - You may need to update or create new line items to work with adaptive sizes. [Learn more](//support.google.com/admanager/answer/9464128).\n\n Orient inline adaptive banner size\n\n To preload an inline adaptive banner ad for a specific orientation, use the\n following methods:\n - [`GADPortraitInlineAdaptiveBannerAdSizeWithWidth(CGFloat width)`](/ad-manager/mobile-ads-sdk/ios/api/reference/Functions#gadportraitinlineadaptivebanneradsizewithwidth)\n\n - [`GADLandscapeInlineAdaptiveBannerAdSizeWithWidth(CGFloat width)`](/ad-manager/mobile-ads-sdk/ios/api/reference/Functions#gadlandscapeinlineadaptivebanneradsizewithwidth)\n\n If your app supports both portrait and landscape views, and you want to preload\n an adaptive banner ad in the current orientation, use\n\n [`GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(CGFloat width)`](/ad-manager/mobile-ads-sdk/ios/api/reference/Functions#gadcurrentorientationinlineadaptivebanneradsizewithwidth)\n\n This method loads an ad in the current orientation.\n\n Limit inline adaptive banner height\n\n By default, inline adaptive banners instantiated without a `maxHeight` value\n have a `maxHeight` equal to the device height. To limit the inline adaptive\n banner height, use the\n\n [`GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(CGFloat width, CGFloat maxHeight)`](/ad-manager/mobile-ads-sdk/ios/api/reference/Functions#gadinlineadaptivebanneradsizewithwidthandmaxheight)\n\n method.\n\n Additional resources\n\n Examples on GitHub\n\n Download the sample application to see inline adaptive banners in action.\n\n [Swift](//github.com/googleads/googleads-mobile-ios-examples/tree/main/Swift/advanced/InlineAdaptiveBannerExample)\n [Objective-C](//github.com/googleads/googleads-mobile-ios-examples/tree/main/Objective-C/advanced/InlineAdaptiveBannerExample)"]]