1

我想将广告横幅 startapp 放在屏幕底部。它一直出现在顶部。我希望它位于屏幕底部,您可以在此处找到我的代码。
我正在尝试将广告定位在屏幕底部,但我尝试的任何方法似乎都不起作用。

下面是布局的 XML 代码,非常感谢。

    <android.support.constraint.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@mipmap/pictureone"
        tools:context="org.sna.myapplication.MainActivity">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:background="@mipmap/pictureone"
        android:weightSum="10"
        android:clickable="false">

        <TextView
            android:layout_width="340dp"
            android:layout_height="wrap_content"
            android:text="click NEXT  to start the application"
            android:id="@+id/textView3"
            android:layout_gravity="center_horizontal"
            android:textColor="#ffffff"
            android:textSize="30dp"
            android:layout_weight="1.58"
            android:textAlignment="center" />

        <ImageView
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:id="@+id/imageView6"
            android:layout_gravity="center_horizontal"
            android:layout_weight="1"
            android:background="@mipmap/oussama"
            android:layout_marginTop="1dp"
            android:clickable="true"
            android:onClick="next" />

    </LinearLayout>

<com.startapp.android.publish.ads.banner.Banner
    android:id="@+id/startAppBanner"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    tools:layout_editor_absoluteY="0dp"
    tools:layout_editor_absoluteX="0dp" />   
</android.support.constraint.ConstraintLayout>   
4

1 回答 1

0

将横幅放置在您的 LinearLayout 中

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:background="@mipmap/pictureone"
    android:weightSum="10"
    android:clickable="false">

    <TextView
        android:layout_width="340dp"
        android:layout_height="wrap_content"
        android:text="click NEXT  to start the application"
        android:id="@+id/textView3"
        android:layout_gravity="center_horizontal"
        android:textColor="#ffffff"
        android:textSize="30dp"
        android:layout_weight="1.58"
        android:textAlignment="center" />

    <ImageView
        android:layout_width="150dp"
        android:layout_height="wrap_content"
        android:id="@+id/imageView6"
        android:layout_gravity="center_horizontal"
        android:layout_weight="1"
        android:background="@mipmap/oussama"
        android:layout_marginTop="1dp"
        android:clickable="true"
        android:onClick="next" />

    <com.startapp.android.publish.ads.banner.Banner
        android:id="@+id/startAppBanner"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        tools:layout_editor_absoluteY="0dp"
        tools:layout_editor_absoluteX="0dp" />

</LinearLayout>
于 2017-10-21T04:04:50.837 回答