首页 > 解决方案 > 我怎样才能堆叠这些横幅

问题描述

我怎样才能堆叠这些横幅。你能帮我解决这个问题吗?

和横幅代码是否正确?当我添加另一个banner时,直接复制粘贴就够了吗?

在此处输入图像描述

代码...

<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="ca-app-pub-3940256099942544/6300978111"
        android:layout_gravity="bottom">

    </com.google.android.gms.ads.AdView>
    

    <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"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-3940256099942544/6300978111">

    </com.google.android.gms.ads.AdView>

标签: javaandroidandroid-studioadmob

解决方案


我们没有太多关于代码结构的信息,但通常,要垂直堆叠项目,您需要使用LinearLayout


推荐阅读