2014-10-04 42 views
1

在admob testad中,在xmlns:ads設置中,我們使用哪些設置?admob xlmns設置的廣告錯誤「所需xml屬性adsize失蹤」

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

在谷歌開發者網站,沒有3)被使用,但是當我使用它,沒有廣告出現在所有。但是當我選擇1)或2)時,我會在廣告的位置出現錯誤。帶有紅色文字的黑色背景,上面寫着「需要的xml屬性adsize缺失」。

回答

1

你可以在你的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

+1

它的工作原理。謝謝。 – user65163 2014-10-04 08:36:25

相關問題