1

I want to place ad banner startapp at bottom of screen. it keeps appears on the top . i want it to be in the buttom of the screen you find my code down here ..
I am trying to position the ad at the bottom of the screen but nothing I try seems to work.

Below is the XML code for the layout thanks a lot .

    <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>   
Madara
  • 11
  • 3

1 Answers1

0

Place the banner within your 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>
William
  • 20,150
  • 8
  • 49
  • 91