android-linearlayoutadviewbottom-up

adview not showing with bottom on linearlayout


I want to add applications to the ad. But I fail I want to add about the position advertised. Codes are as follows:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="info.androidhive.materialtabs.fragments.OneFragment">


    <TextView
        android:id="@+id/tarih"
        android:textColor="#04B038"
        android:textSize="15dp"
        android:textStyle="bold"
        android:layout_marginTop="5dp"
        android:layout_gravity="center_horizontal"
        android:text=""
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <ListView
            android:id="@+id/olaylar_liste"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"></ListView>

        <ProgressBar
            android:layout_gravity="center_vertical|center_horizontal"
            android:id="@+id/progress_olaylar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </FrameLayout>


        <LinearLayout
            android:layout_gravity="bottom"
            android:orientation="horizontal"
            android:id="@+id/adLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"></LinearLayout>


</LinearLayout>

I want adview showing bottom on linearlayout. Adview @ + id /adLayout will be displayed on the Layout Please help me.


Solution

  • try this

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        tools:context="info.androidhive.materialtabs.fragments.OneFragment">
    
    
        <TextView
            android:id="@+id/tarih"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="5dp"
            android:text="Header"
            android:textColor="#04B038"
            android:textSize="15dp"
            android:textStyle="bold" />
    
        <LinearLayout
            android:id="@+id/adLayout"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_alignParentBottom="true"
            android:layout_gravity="bottom"
            android:background="#ff0000"
            android:orientation="horizontal"></LinearLayout>
    
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_above="@+id/adLayout"
            android:layout_below="@+id/tarih">
    
            <ListView
                android:id="@+id/olaylar_liste"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"></ListView>
    
            <ProgressBar
                android:id="@+id/progress_olaylar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|center_horizontal" />
    
        </FrameLayout>
    
    
    </RelativeLayout>