gpt4 book ai didi

android - 广告错误 "required xml attribute adsize was missing"的 admob xlmns 设置

转载 作者:行者123 更新时间:2023-11-30 02:38:06 29 4
gpt4 key购买 nike

在admob testad中,在xmlns:ads设置中,我们使用哪个?

1) http://schemas.android.com/apk/lib/com.android.google.gms.ads

2) http://schemas.android.com/apk/lib/com.google.ads

3) http://schemas.android.com/apk/res-auto

在google developer site中,没有使用3),但是当我使用它时,根本没有出现任何广告。但是,当我选择 1) 或 2) 时,我会在广告位置出现错误。带有红色文本的黑色背景,上面写着“缺少所需的 xml 属性广告大小”..

最佳答案

你可以在你的 xml 文件中尝试这个东西。

<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adUnitId="YOUR_AD_UNIT_ID"
ads:adSize="BANNER"/>

或关注thisthis在您的代码中使用 admob 教程。

关于android - 广告错误 "required xml attribute adsize was missing"的 admob xlmns 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26189231/

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