Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Anchored Adaptive Banner AdSize problem

18 views
Skip to first unread message

zhou

unread,
Apr 24, 2025, 11:02:07 AMApr 24
to Google Mobile Ads SDK Developers
In my project, I'm using Anchored Adaptive Banner AdSize. The key code is as follows:   DisplayMetrics outMetrics = Resources.getSystem().getDisplayMetrics();
float widthPixels = outMetrics.widthPixels;
float density = outMetrics.density;
int adWidth = (int) (widthPixels / density)
AdView adView = new AdView(context);
adView.setAdSize(AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(ConfigApplication.getContext(), adWidth))
In the production environment, we have found that:
屏幕截图 2025-04-24 111350.png After checking with the tool Layout Inspector, it was found that:
  1. Sometimes the width of the banner ad view (adView) being displayed is smaller than the screen width.

  2. Sometimes the adView width is normal, but the content inside it is smaller than the screen width and is not centered.

how to solve the problem? admob version: 23.2.0
Reply all
Reply to author
Forward
0 new messages