相对布局并移除了Google横幅广告

时间:2017-08-09 08:15:12

标签: android layout admob relative

我有一个相对布局,其中包含来自admob的广告。一切正常。但我让我的用户购买广告(通过应用内购买删除广告)。但是当广告被删除时(设置它看不见),设计"崩溃"。所有元素都位于屏幕顶部堆叠。在广告中有一个参数:

机器人:layout_alignParentBottom ="真"

这似乎是删除它时出现这种奇怪行为的原因。

如何修复布局?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/game_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/bg_activity"
    android:orientation="vertical" >

    <RelativeLayout>      
    </RelativeLayout>

    <ImageView>


    <LinearLayout

    </LinearLayout>

    <LinearLayout

        </LinearLayout>


    </LinearLayout>

    <com.google.android.gms.ads.AdView
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        ads:adSize="BANNER"
        ads:adUnitId="@string/banner_ad_unit_id">
    </com.google.android.gms.ads.AdView>


</RelativeLayout>

0 个答案:

没有答案