我怎样才能堆叠这些横幅

时间:2021-02-07 18:32:45

标签: java android android-studio admob

我如何堆叠这些横幅。你能帮我解决这个问题吗?

和横幅代码是否正确?当我添加另一个横幅时,是否可以直接复制粘贴?

enter image description here

代码...

<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>

1 个答案:

答案 0 :(得分:0)

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

相关问题