title: Changing the height of ConstraintLayout from wrap-content to 0dp changes height of children
body: <p>Basically, I have a ConstraintLayout as a root and then 2 ConstraintLayouts as children, aligned vertically (with wrap-content as their height) and a final third one, to fill all remaining space (0dp height, all constraints are set). However, this third ConstraintLayout, first had wrap-content as its height and when I changed the height to 0dp, all of the Views within the third layout looked like they have no height (they have wrap-content as their height, this does not change). When I manually enter a height e.g. '30dp' as a View's height, it works, but wrap-content for a Views's height does not work. Also, setting a constraint i.e. for Bottom lifts the view up. Does anyone know what's going on?</p>
  
  <p><a href="https://gyazo.com/a11c5fa030d4118fdf0f21ffcc886d6e" rel="nofollow noreferrer">This</a> is the behaviour I am getting.</p>
  
  <blockquote>
    <p>== ConstraintLayout (root)</p>
    
    <p>== ConstraintLayout (wrap-content)</p>
    
    <p>== ConstraintLayout (wrap-content)</p>
    
    <p>== ConstraintLayout (height and width 0dp, all constraints set, fill remaining space)</p>
    
    <p>=== View (0dp as width and wrap_content as height, however, no height is shown (mainly ImageView and EditTexts)).</p>
  </blockquote>
  
  <p>See this <a href="https://i.stack.imgur.com/pI6U3.png" rel="nofollow noreferrer">image</a>, the red area is the ConstraintLayout I'm having problems with and the View within the layout are yellow colored.</p>
  
  <p>This is my whole Layout file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&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:layout_width="match_parent" android:layout_height="match_parent"&gt;
  
      &lt;android.support.constraint.ConstraintLayout android:layout_width="0dp" android:layout_height="wrap_content"
          android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginLeft="8dp"
          app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent"
          android:layout_marginTop="16dp" android:id="@+id/constraintLayout28" android:layout_marginStart="8dp"
          android:layout_marginEnd="8dp"&gt;
  
          &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content"
              app:srcCompat="@drawable/ic_team" android:id="@+id/imageView17" app:layout_constraintTop_toTopOf="parent"
              android:layout_marginTop="8dp" android:layout_marginLeft="8dp" app:layout_constraintLeft_toLeftOf="parent"
              app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="8dp" android:layout_marginStart="8dp" /&gt;
          &lt;AutoCompleteTextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              android:id="@+id/cL1" app:layout_constraintLeft_toRightOf="@+id/imageView17"
              android:layout_marginLeft="8dp" app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="8dp"
              android:layout_marginStart="8dp" android:padding="4dp" android:background="@drawable/edittext"
              android:layout_marginEnd="8dp" android:hint="Opdrachtgever*" /&gt;
          &lt;LinearLayout android:orientation="horizontal" android:layout_width="0dp" android:layout_height="wrap_content"
              android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/cL1"
              android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintLeft_toRightOf="@+id/imageView17" android:layout_marginLeft="8dp"
              app:layout_constraintHorizontal_bias="0.0" app:layout_constraintBottom_toBottomOf="parent"
              android:layout_marginBottom="8dp" android:layout_marginStart="8dp" android:layout_marginEnd="8dp"&gt;
              &lt;AutoCompleteTextView android:layout_width="0dp" android:layout_height="wrap_content"
                  android:id="@+id/cL2" android:padding="4dp" android:background="@drawable/edittext"
                  android:layout_weight="1" android:layout_marginRight="4dp" android:hint="Voornaam" /&gt;
              &lt;AutoCompleteTextView android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/cL3"
                  android:padding="4dp" android:background="@drawable/edittext" android:layout_weight="1" android:layout_marginLeft="4dp"
                  android:hint="Achternaam" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
      &lt;android.support.constraint.ConstraintLayout android:layout_width="0dp" android:layout_height="1px"
          android:layout_marginTop="16dp" app:layout_constraintTop_toBottomOf="@+id/constraintLayout28"
          android:layout_marginLeft="8dp" app:layout_constraintLeft_toLeftOf="parent" android:layout_marginRight="8dp"
          app:layout_constraintRight_toRightOf="parent" android:background="@color/dividerColor"
          android:id="@+id/constraintLayout29" android:layout_marginStart="8dp" android:layout_marginEnd="8dp"&gt;
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
      &lt;android.support.constraint.ConstraintLayout android:layout_width="0dp" android:layout_height="wrap_content"
          android:layout_marginTop="16dp" app:layout_constraintTop_toBottomOf="@+id/constraintLayout29"
          android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginLeft="8dp"
          app:layout_constraintLeft_toLeftOf="parent" android:id="@+id/constraintLayout30"
          android:layout_marginStart="8dp" android:layout_marginEnd="8dp"&gt;
  
          &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content"
              app:srcCompat="@drawable/ic_location" android:id="@+id/imageView19" android:layout_marginLeft="8dp"
              app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent"
              android:layout_marginTop="8dp" app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="8dp"
              android:layout_marginStart="8dp" /&gt;
          &lt;LinearLayout android:orientation="horizontal" android:layout_width="0dp" android:layout_height="wrap_content"
              app:layout_constraintLeft_toRightOf="@+id/imageView19" android:layout_marginLeft="8dp"
              android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="8dp" android:weightSum="1"
              app:layout_constraintHorizontal_bias="0.0" android:id="@+id/linearLayout2" android:layout_marginStart="8dp"
              android:layout_marginEnd="8dp"&gt;
              &lt;AutoCompleteTextView android:layout_width="0dp" android:hint="Straat" android:id="@+id/cL4"
                  android:layout_height="wrap_content" android:padding="4dp" android:background="@drawable/edittext"
                  android:layout_weight="0.8" android:layout_marginRight="4dp" /&gt;
              &lt;EditText android:layout_width="0dp" android:hint="#" android:id="@+id/cL4Number"
                  android:layout_height="wrap_content" android:padding="4dp" android:background="@drawable/edittext"
                  android:layout_weight="0.2" android:layout_marginLeft="4dp" /&gt;
          &lt;/LinearLayout&gt;
          &lt;EditText android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/cL5"
              android:hint="Stad" android:padding="4dp" android:background="@drawable/edittext" android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
              android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintLeft_toRightOf="@+id/imageView19" android:layout_marginLeft="8dp"
              app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="8dp"
              android:layout_marginStart="8dp" android:layout_marginEnd="8dp" /&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
      &lt;android.support.constraint.ConstraintLayout android:layout_width="0dp" android:layout_height="1px"
          android:layout_marginTop="16dp" app:layout_constraintTop_toBottomOf="@+id/constraintLayout30"
          android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginLeft="8dp"
          app:layout_constraintLeft_toLeftOf="parent" android:background="@color/dividerColor"
          android:id="@+id/constraintLayout31" android:layout_marginStart="8dp" android:layout_marginEnd="8dp"&gt;
  
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;android.support.constraint.ConstraintLayout
          android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginLeft="8dp"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/constraintLayout31" android:layout_marginTop="16dp"
          android:layout_marginBottom="8dp" app:layout_constraintBottom_toTopOf="@+id/cL6"
          android:layout_width="0dp" android:layout_height="0dp"&gt;
  
  
          &lt;ImageView android:layout_width="0dp" android:layout_height="0dp" app:srcCompat="@drawable/ic_description"
              android:id="@+id/imageView20" android:layout_marginLeft="8dp" app:layout_constraintLeft_toLeftOf="parent"
              app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="8dp"
              app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="8dp"
              app:layout_constraintVertical_bias="1.0" /&gt;
          &lt;EditText android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/cL7"
              android:hint="Referentie nummer"  app:layout_constraintTop_toTopOf="parent"
              android:layout_marginTop="8dp" android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintLeft_toRightOf="@+id/imageView20" android:layout_marginLeft="8dp" android:padding="4dp"
              android:background="@drawable/edittext" /&gt;
          &lt;AutoCompleteTextView android:layout_width="0dp" android:layout_height="wrap_content" android:id="@+id/cL8"
              android:hint="Project" android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/cL7"
              app:layout_constraintLeft_toRightOf="@+id/imageView20" android:layout_marginLeft="8dp"
              android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintHorizontal_bias="0.0" android:padding="4dp" android:background="@drawable/edittext" /&gt;
          &lt;EditText android:layout_width="0dp" android:layout_height="0dp" android:id="@+id/cL9"
              android:hint="Omschrijving" android:layout_marginRight="8dp" app:layout_constraintRight_toRightOf="parent"
              app:layout_constraintLeft_toRightOf="@+id/imageView20" android:layout_marginLeft="8dp" android:padding="4dp"
              android:background="@drawable/edittext" app:layout_constraintHorizontal_bias="0.0" android:layout_marginTop="8dp"
              app:layout_constraintTop_toBottomOf="@+id/cL8"
              app:layout_constraintBottom_toBottomOf="parent" android:layout_marginBottom="8dp" /&gt;
      &lt;/android.support.constraint.ConstraintLayout&gt;
  
      &lt;ImageView android:layout_width="0dp" android:layout_height="wrap_content"
          app:srcCompat="@drawable/bt_cL6" android:id="@+id/cL6"
          app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintLeft_toLeftOf="parent" android:adjustViewBounds="true" android:scaleType="fitXY" /&gt;
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>