title: Android ConstraintLayout leaves content on the outside when the content is very large
body: <p>I have a ScrollView which has a ConstraintLayout. I am trying to load a content, but when the content is too large, I start loosing the footer. This works fine when I have short or medium content, but only happens with very very large content.</p>
  
  <p><a href="https://i.stack.imgur.com/ADUNe.png" rel="nofollow noreferrer">This is the problem</a>
  <a href="https://i.stack.imgur.com/XjaRc.png" rel="nofollow noreferrer">This is the structure of my layout</a></p>
  
  <p>I am doing the inspection with the Layout inspector and this is the result</p>
  
  <p><a href="https://i.stack.imgur.com/7kFqG.png" rel="nofollow noreferrer">This is the result of the Layout Inspector</a>
  <a href="https://i.stack.imgur.com/jULHZ.png" rel="nofollow noreferrer">This is the structure of the layout in the Inspector</a></p>
  
  <p>Any Idea?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView 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:id="@+id/id_scv_article_detail"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:visibility="invisible"
  tools:context=".ui.activities.contents.ArticleDetailActivity"&gt;
  
  &lt;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:id="@+id/id_cnt_article_detail"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:visibility="visible"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/id_article_detail_toolbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="?attr/colorPrimary"
          android:clickable="true"
          android:focusable="true"
          android:minHeight="?attr/actionBarSize"
          android:textAlignment="center"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:titleTextAppearance="@style/TitleBarTextAppearance" /&gt;
  
      &lt;ImageView
          android:id="@+id/id_img_article_det"
          android:layout_width="match_parent"
          android:layout_height="180dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:scaleType="centerCrop"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_article_detail_toolbar"
          app:srcCompat="@drawable/no_image" /&gt;
  
      &lt;TextView
          android:id="@+id/id_txt_title_article_det"
          android:layout_width="wrap_content"
          android:layout_height="0dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_bold"
          android:text="@string/info_not_title_defined"
          android:textSize="18sp"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_img_article_det" /&gt;
  
      &lt;TextView
          android:id="@+id/id_txt_summary_article_det"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_medium"
          android:text="@string/info_not_short_text_defined"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_txt_title_article_det" /&gt;
  
      &lt;LinearLayout
          android:id="@+id/ln_text_content_article"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:background="@drawable/linear_layout_bg"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_txt_summary_article_det"&gt;
  
          &lt;TextView
              android:id="@+id/id_txt_text_article_det"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_margin="8dp"
  
              android:fontFamily="@font/roboto_regular"
              android:text="@string/textoooo" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:id="@+id/id_cnt_gallery_article_det"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/ln_text_content_article"&gt;
  
          &lt;TextView
              android:id="@+id/id_txt_title_gallery"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginStart="8dp"
              android:layout_marginTop="8dp"
              android:fontFamily="@font/roboto_bold"
              android:text="@string/title_gallery"
              android:textColor="@color/colorSecondary"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/id_recycler_view_gallery"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/id_txt_title_gallery" /&gt;
  
          &lt;Button
              android:id="@+id/button3"
              android:layout_width="0dp"
              android:layout_height="2dp"
              android:layout_marginEnd="32dp"
              android:layout_marginTop="8dp"
              android:background="@color/colorLines"
              android:backgroundTint="@color/colorLines"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/id_recycler_view_gallery" /&gt;
  
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:id="@+id/id_cnt_calendar_article_det"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_cnt_gallery_article_det"&gt;
  
          &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:app="http://schemas.android.com/apk/res-auto"
              android:id="@+id/id_calendar_article"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;include
                  android:id="@id/id_calendar_article"
                  layout="@layout/recycler_view_calendar"&gt;
  
              &lt;/include&gt;
  
          &lt;/android.support.constraint.ConstraintLayout&gt;
  
          &lt;Button
              android:id="@+id/button4"
              android:layout_width="0dp"
              android:layout_height="2dp"
              android:layout_marginEnd="32dp"
              android:layout_marginTop="8dp"
              android:background="@color/colorLines"
              android:backgroundTint="@color/colorLines"
              android:visibility="visible"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/id_calendar_article" /&gt;
  
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:id="@+id/id_cnt_resources_article_det"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_cnt_calendar_article_det"&gt;
  
          &lt;LinearLayout
              android:id="@+id/ln_document_article"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="8dp"
              android:gravity="center_vertical"
              android:orientation="horizontal"
              android:weightSum="10"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="parent"&gt;
  
  
              &lt;ImageView
                  android:id="@+id/imageView4"
                  android:layout_width="0dp"
                  android:layout_height="40dp"
                  android:layout_weight="2"
                  app:srcCompat="@drawable/pdf_icon" /&gt;
  
              &lt;TextView
                  android:id="@+id/id_name_pdf_article"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="6"
                  android:ellipsize="end"
                  android:fontFamily="@font/roboto_regular"
                  android:maxLines="2"
                  android:text="@string/info_not_title_defined" /&gt;
  
              &lt;ImageView
                  android:id="@+id/id_img_download_pdf_article"
                  android:layout_width="0dp"
                  android:layout_height="30dp"
                  android:layout_weight="2"
                  app:srcCompat="@drawable/download_icon" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;View
              android:id="@+id/id_ln_document_separator"
              android:layout_width="match_parent"
              android:layout_height="2dp"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="8dp"
              android:background="#DEDEDE"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/ln_document_article" /&gt;
  
  
          &lt;LinearLayout
              android:id="@+id/ln_link_article"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="10dp"
              android:gravity="center_vertical"
              android:orientation="horizontal"
              android:weightSum="10"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/id_ln_document_separator"&gt;
  
  
              &lt;TextView
                  android:id="@+id/id_txt_link_article"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginLeft="15dp"
                  android:layout_weight="5"
                  android:fontFamily="@font/roboto_medium"
                  android:maxLines="2"
                  android:text="@string/info_not_title_defined" /&gt;
  
              &lt;TextView
                  android:id="@+id/id_txt_copy_link_article"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="3"
                  android:fontFamily="@font/roboto_regular"
                  android:text="@string/lbl_copy_link"
                  android:textAlignment="textEnd"
                  android:textColor="?android:attr/colorEdgeEffect" /&gt;
  
              &lt;TextView
                  android:id="@+id/id_txt_go_link_article"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="2"
                  android:fontFamily="@font/roboto_regular"
                  android:text="@string/lbl_go"
                  android:textAlignment="center"
                  android:textColor="?android:attr/colorEdgeEffect" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;View
              android:id="@+id/id_ln_link_separator"
              android:layout_width="match_parent"
              android:layout_height="2dp"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="8dp"
              android:background="#DEDEDE"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/ln_link_article" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/ln_image_article"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginEnd="8dp"
              android:layout_marginStart="8dp"
              android:layout_marginTop="8dp"
              android:orientation="horizontal"
              android:weightSum="10"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@id/id_ln_link_separator"&gt;
  
  
              &lt;ImageView
                  android:id="@+id/id_img_img_article"
                  android:layout_width="0dp"
                  android:layout_height="80dp"
                  android:layout_margin="8dp"
                  android:layout_weight="4"
                  android:scaleType="centerCrop"
                  app:srcCompat="@drawable/no_image" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="6"
                  android:gravity="center"
                  android:orientation="vertical"&gt;
  
  
                  &lt;TextView
                      android:id="@+id/id_txt_name_img_article"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:fontFamily="@font/roboto_regular"
                      android:text="@string/info_not_title_defined" /&gt;
  
                  &lt;TextView
                      android:id="@+id/id_txt_download_img_article"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:fontFamily="@font/roboto_regular"
                      android:text="@string/lbl_download"
                      android:textColor="?android:attr/colorEdgeEffect" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
  
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;View
          android:id="@+id/view1"
          android:layout_width="match_parent"
          android:layout_height="2dp"
          android:layout_marginTop="8dp"
          android:background="@color/colorLines"
          app:layout_constraintStart_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/id_cnt_resources_article_det" /&gt;
  
      &lt;TextView
          android:id="@+id/textView13"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_bold"
          android:text="@string/lbl_author"
          android:textColor="@color/colorSecondary"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/view1" /&gt;
  
      &lt;TextView
          android:id="@+id/id_txt_author_article"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="80dp"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_regular"
          android:text="@string/info_not_art_author_defined"
          app:layout_constraintStart_toStartOf="@+id/textView13"
          app:layout_constraintTop_toBottomOf="@+id/view1" /&gt;
  
      &lt;TextView
          android:id="@+id/textView14"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_bold"
          android:text="@string/lbl_publication_date"
          android:textColor="@color/colorSecondary"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/textView13" /&gt;
  
      &lt;TextView
          android:id="@+id/id_txt_publication_date_article"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_regular"
          android:text="@string/info_not_art_defined"
          app:layout_constraintStart_toStartOf="@+id/id_txt_author_article"
          app:layout_constraintTop_toBottomOf="@+id/id_txt_author_article" /&gt;
  
      &lt;TextView
          android:id="@+id/textView16"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="16dp"
          android:layout_marginTop="8dp"
          android:fontFamily="@font/roboto_bold"
          android:text="@string/lbl_last_modification_date"
          android:textColor="@color/colorSecondary"
          app:layout_constraintStart_toEndOf="@+id/id_txt_publication_date_article"
          app:layout_constraintTop_toBottomOf="@+id/id_txt_author_article" /&gt;
  
      &lt;TextView
          android:id="@+id/id_txt_last_update_date_article"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginStart="16dp"
          android:fontFamily="@font/roboto_regular"
          android:text="@string/info_not_art_defined"
          app:layout_constraintStart_toEndOf="@+id/textView16"
          app:layout_constraintTop_toTopOf="@+id/textView16" /&gt;
  
      &lt;Button
          android:id="@+id/button6"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginEnd="32dp"
          android:layout_marginTop="32dp"
          android:background="@android:color/white"
          android:backgroundTint="@android:color/white"
          android:visibility="invisible"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/textView13" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p></p>