我是在游戏中使用 admob 的新手。它显示在左上角,但我想显示在中心。这是我的代码。谢谢你提前。
Window window = getWindow();
RelativeLayout adsLayout = new RelativeLayout(this);
RelativeLayout.LayoutParams Param = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
Param.addRule(RelativeLayout.CENTER_HORIZONTAL, RelativeLayout.TRUE);
AdView adView = new AdView(this, AdSize.BANNER, "a14******");
AdRequest adRequest = new AdRequest();
adView.loadAd(adRequest);
adsLayout.addView(adView,Param);
window.addContentView(adsLayout,Param);