1

正如下面我的布局代码部分所述,我的布局应该将我的 AdView 横幅定位在屏幕的左上角,它确实如此。但在某些情况下,它还会在屏幕中央显示一个大小相同、内容不同的附加横幅(“坏横幅”)。请参阅我的平板电脑全屏 (1280x800) 的附加屏幕截图。

我的代码中只有一个 AdView 实例。

我不知道它是否相关,但是当我的应用程序通过另一个应用程序的意图过滤器(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>
4

1 回答 1

0

您的代码似乎是正确的,尝试清理您的项目并再次运行。另一种解决方案是,一旦从 xml 中删除您的 imageview,然后检查输出。

于 2012-12-14T04:38:39.900 回答