Hi,
Thank you for contacting the Mobile Ads SDK support team.
When you create an inline adaptive banner ad, you need to specify the width of the ad and a maximum height. The SDK will then return an AdSize object with the actual height of the ad. However, the SDK does not automatically adjust the frame of the BannerView to match the height of the ad.
To workaround this issue, you need to manually adjust the frame of the BannerView after the ad has loaded. You can do this in the bannerViewDidReceiveAd: delegate method. Here is an example:
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
// Get the height of the ad.
let adHeight = bannerView.ad.adSize.height
// Adjust the frame of the BannerView to match the height of the ad.
bannerView.frame.size.height = adHeight
}
For more information, please refer the following links:
https://developers.google.com/admob/ios/banner/anchored-adaptive
![]() |
Mobile Ads SDK Team |
GAMBannerView(adSize: adSize)
the GAMBannerView at this point in time is 393x63
The outgoing request to the ad server is using 393x63. The bannerViewDidReceiveAd's bannerView argument does not contain an ad
'GADBannerView' has no member 'ad'
bannerView.ad.adSize.height
bannerView.adSize reflects 393x63
Hi,
Thank you for getting back to us.
Upon reviewing your concern you are facing an issue with ad requests for Banner view. Kindly share the below information to investigate further.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
1. Navigate to
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
Are there any resources I can review working with inline adaptive (variable height) ads within a TableView? I seem to be running into a chicken and egg scenario where I set up an initial BannerView with a certain size but declare adSize as “Adpative with Max Height = X” however the SDK seems to be using the Banner View frame dimensions instead of the adSize. This is true whether I use "GADAdSizeBanner" or "GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(320, 400)" With "GADAdSizeBanner" I can at least set up my frame to match ahead of time. Ideally the SDK would honor the requested ad size instead of the frame size and in the delegate "bannerViewDidReceiveAd" tell me the size of the ad loaded that way I can adjust the size of the containing Banner View.
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/4c83cec2-a0dd-4078-982a-3a7249b78d59n%40googlegroups.com.
Hi,
Thank you for contacting the Mobile Ads SDK support team.
Please note that we received only a “ya” message from you. Could you please specify if you are facing any issues related to Google Mobile Ads SDK?
![]() |
Mobile Ads SDK Team |
Hi,
Thank you for getting back to us.
Please note that to create an inline adaptive banner ad size in swift:
let adSize = GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(bannerView.frame.width, 400)
bannerView = GAMBannerView(adSize: adSize)
This will create an inline adaptive banner ad that is up to 400 pixels in height. The actual height of the ad will be determined by the ad network.
Once the ad has loaded, the bannerViewDidReceiveAd: delegate method will be called. In this method, you can get the actual size of the ad using the bannerView.adSize property. You can then use this size to resize the banner view.
For example, the following code would resize the banner view to match the size of the ad:
func bannerViewDidReceiveAd(_ bannerView: GAMBannerView) {
let adSize = bannerView.adSize
bannerView.frame = CGRect(x: 0, y: 0, width: adSize.width, height: adSize.height)
}
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/CAOGcDgb3yYvC%3DsWBTSoC0k7GeT44oatD2tdngFXecMXuFRVdkw%40mail.gmail.com.
Hi,
Thank you for getting back to us.
Please note that we already requested below information for further investigation.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, kindly provide requested information to us via reply privately to author option or using the steps below:
2. Fill out all fields, and attach your file(s).
3. Please reply back to this thread when you have uploaded your file(s). Please do not share this link.
![]() |
Mobile Ads SDK Team |
Hi Ivan,
Thank you for contacting the Mobile Ads SDK Support team.
Please ignore my previous email. Upon checking the app Id and unit Id you provided, it appears that the application is for Roku.