gpt4 book ai didi

android - Admob 横幅广告未占满宽度

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:19:39 26 4
gpt4 key购买 nike

使用 Admob 横幅广告时,无论是测试广告还是实时广告都没有占据设备的整个宽度。

这是我在布局 xml 中声明的 adView:

<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="bottom"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id"></com.google.android.gms.ads.AdView>

这是呈现的内容:

enter image description here

最佳答案

改变

ads:adSize="BANNER"

ads:adSize="SMART_BANNER"

Smart Banners are new ad units (as of v6.0.0) that will render screen-wide banner ads on any screen size across different devices in either orientation. Smart Banners help deal with increasing screen fragmentation across different devices by "smartly" detecting the width of the phone in its current orientation, and making the ad view that size.

Read more here

关于android - Admob 横幅广告未占满宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34879821/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com