1
正如我在下面的布局代码部分所述,我的布局应该将我的AdView横幅放置在屏幕的左上角。 但在某些情况下,它还向屏幕的中心显示具有不同内容的额外横幅(“坏横幅”),尺寸相同。 请参阅我的完整平板电脑屏幕的截图(1280x800)。为什么有两个AdView横幅?
我的代码中只有一个AdView实例。
我不知道它是否是相关的,但它似乎发生在我的应用程序通过intent-filter(ACTION_VIEW)从另一个应用程序启动,但没有正常启动时启动。
任何想法,第二(恼人的)横幅可能来自哪里?
见截图有:http://i.stack.imgur.com/uYnlm.jpg
<LinearLayout
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/layout_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="horizontal" >
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="a150a91e636e7f9"
ads:color_bg="ffffffff"
ads:loadAdOnCreate="true"
android:gravity="top" />
<ImageButton
android:id="@+id/header_icon_logo"
android:padding="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" />
</LinearLayout>
你帮我找到了我的错误:我无意中在代码中留下了一个“layout.addView(adView)”......这就是第二个adView所显示的内容。感谢Mudassar。 – djonif
我的快乐朋友:) –