title: How to put AdView in ConstraintLayout at bottom and below other stuff?
body: <p>I'm trying to migrate from RelativeLayout to ConstraintLayout but I'm having problems adding the AdMob AdView to the bottom and the rest of the content above it. For example, using RelativeLayout was that simple. You only need to put <code>android:layout_alignParentBottom="true"</code> on the AdView and <code>android:layout_above="@+id/adView"</code> on the view which is containing the stuff.</p>
  
  <p>I'm trying to understand how to migrate this sample code and these two lines of code to the equivalent using a ConstraintLayout instead of a RelativeLayout.</p>
  
  <p>Please, can someone help me with this migration?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout 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="@android:color/transparent"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_above="@+id/adView"/&gt;
  
      &lt;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"
          android:layout_marginTop="5dp"
          ads:adSize="BANNER"
          ads:adUnitId="@string/ad_id_banner"&gt;
      &lt;/com.google.android.gms.ads.AdView&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I tested using <code>app:layout_constraintBottom_toTopOf="@+id/adView"</code> on the stuff i want above the adView and <code>app:layout_constraintBottom_toBottomOf="parent"</code> on the adView but it's not working because the stuff is not above the adView it's behind. And Also the adView is not centered. It's very frustrating.</p>