嗨,我想顯示在片段AD瀏覽,但我沒有得到任何結果,它只顯示空白區域,在活動的正常工作,AdView中的片段沒有顯示
的片段我寫的代碼如下:
XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/innerbg"
xmlns:app="http://schemas.android.com/apk/lib/com.google.ads">
<ListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@null"
android:listSelector="@android:color/transparent"
android:layout_above="@+id/adView"
android:layout_alignParentTop="true"/>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="@string/adunit_id_home"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
在片段:
AdView adViewHome = (AdView) rootView.findViewById(R.id.adViewHome);
AdRequest adRequest = new AdRequest.Builder().build();
adViewHome.loadAd(adRequest);
爲什麼它下來投票?我可以知道原因嗎? –
我不知道爲什麼這些人投票的問題,如果有任何問題,那麼讓我知道,以便我將來不會重複。沒有通知做倒票是不正確的方式,你必須糾正新手 –