【问题标题】:how can I stack these banners [closed]我怎样才能堆叠这些横幅[关闭]
【发布时间】:2021-05-11 11:14:40
【问题描述】:

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

和横幅代码是否正确?当我添加另一个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>

【问题讨论】:

    标签: java android android-studio admob


    【解决方案1】:

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

    【讨论】:

    • 如何使用 relativelayout 做到这一点?
    • 在我看来,使用相对布局很复杂...我强烈建议您使用线性布局或约束布局之类的东西。但是,如果您绝对需要使用相对布局,我很遗憾无法为您提供帮助......我没有足够的经验。
    猜你喜欢
    • 2012-09-03
    • 2016-05-07
    • 2014-12-16
    • 1970-01-01
    • 1970-01-01
    • 2023-03-12
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多