AdMob显示白屏

时间:2014-05-04 21:32:38

标签: android

我在活动中的adb运作良好。但是当我使用include时。但是当我在片段中使用时,它没有显示。我做错了什么?

  <include
        android:id="@+id/adMob"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/elm_adb_mob"
        tools:ignore="NestedWeights" />

1 个答案:

答案 0 :(得分:0)

为什么要包含布局?只需创建AdView而不是包含。

<com.google.android.gms.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="MY_AD_UNIT_ID"
                         ads:adSize="BANNER"/>

了解更多here