title: Place a View at Bottom in ScrollView/LinearLayout
body: <p>I've just started with Android and was developing my first app that includes a Login Screen. </p>
  
  <p>Initially, I had used <code>RelativeLayout</code> and <code>AdView</code> or any other View was getting correctly placed to the bottom of the parent using <code>android:layout_alignParentBottom="true"</code>.</p>
  
  <p>Then, while reading about Material Guidelines, I was referring to a XML that used <code>LinearLayout</code> inside <code>ScrollView</code>. Now I can't place my <code>AdView</code> to the bottom most position (try importing this XML to your Android Studio). Searching for answers here, I also placed it inside <code>RelativeLayout</code> and used <code>android:layout_alignParentBottom="true"</code> again but no success. I know Android users have played with all this and I hope they can help me.</p>
  
  <p><strong>So, listing my basic questions as:</strong></p>
  
  <ul>
  <li><strong><em>Can you tell me the actual use the OP has used <code>ScrollView</code> for Login Screen Activity? If you know how to handle UI of the activity, can you just post two or more lines of any tip on what should I use? Any tip would be highly appreciated.</em></strong></li>
  <li><strong><em>Main Question - So, how do I place <code>AdView</code> to the bottom? An explanation would be appreciated.</em></strong> </li>
  </ul>
  
  <p>Thanks. :)</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:ads="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:fitsSystemWindows="true"
      android:background="#FFB74D"&gt;
  
      &lt;LinearLayout
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingTop="15dp"
          android:paddingLeft="24dp"
          android:paddingRight="24dp"
          android:backgroundTintMode="src_atop"&gt;
  
          &lt;RelativeLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="0.5"
              android:orientation="vertical"&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_centerInParent="true"
                  android:gravity="center"
                  android:text="Gyaanify"
                  android:textSize="55sp"
                  android:textColor="#FF3D00"
                  android:textStyle="normal|bold"
                  android:textAllCaps="false"
                  android:textAlignment="center"
                  android:fontFamily="cursive"
                  android:layout_margin="10dp" /&gt;
  
          &lt;/RelativeLayout&gt;
  
          &lt;!-- Email Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="8dp"
              android:layout_marginBottom="8dp"&gt;
              &lt;EditText android:id="@+id/etUserName"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:inputType="textEmailAddress"
                  android:hint="Email" /&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;!-- Password Label --&gt;
          &lt;android.support.design.widget.TextInputLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="8dp"
              android:layout_marginBottom="8dp"&gt;
              &lt;EditText android:id="@+id/etPassword"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:inputType="textPassword"
                  android:hint="Password"/&gt;
          &lt;/android.support.design.widget.TextInputLayout&gt;
  
          &lt;android.support.v7.widget.AppCompatButton
              android:id="@+id/btn_login"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="15dp"
              android:layout_marginBottom="24dp"
              android:padding="20dp"
              android:text="Login"
              android:onClick="OnLogin"
              android:background="#EF6C00"
              android:textColor="@android:color/background_light" /&gt;
  
          &lt;TextView android:id="@+id/link_signup"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:text="No account yet? Create one"
              android:gravity="center"
              android:textSize="16dip"
              android:layout_marginTop="40dp" /&gt;
  
          &lt;android.support.v7.widget.AppCompatButton
              android:id="@+id/btn_register"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="24dp"
              android:text="Register @ Gyaanify"
              android:onClick="OnRegister"
              android:padding="20dp"
              android:layout_marginTop="10dp"
              android:background="#EF6C00"
              android:textColor="@android:color/background_light" /&gt;
  
          &lt;RelativeLayout
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="0.5"
              android:orientation="vertical"
              android:layout_alignParentBottom="true"&gt;
  
          &lt;com.google.android.gms.ads.AdView
              android:id="@+id/adView"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_centerHorizontal="true"
              android:layout_alignParentBottom="true"
              ads:adSize="BANNER"
              ads:adUnitId="@string/banner_ad_unit_id"&gt;
          &lt;/com.google.android.gms.ads.AdView&gt;
          &lt;/RelativeLayout&gt;
  
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  </code></pre>