title: ConstraintLayout doesn't respect max height
body: <p>I'm trying to create a layout composition using ConstraintLayout.
  In order to simplify my case, my layout should have three parts:</p>
  
  <ol>
  <li>The first layout (in red), that should grow according to the remaining space and has a max height.</li>
  <li>The second layout (in green), which has a fixed size of 150dp and should always be below the first layout.</li>
  <li>The first layout (in pink), also has a fixed size of 150dp and should be aligned to the bottom the view.</li>
  </ol>
  
  <p>The part I'm struggling with is setting a max height for the first layout (red). It seems like the ConstraintLayout ignores my "max height statements": </p>
  
  <pre><code>app:layout_constraintHeight_max="300dp"
  </code></pre>
  
  <p>Here's my current result (the red part ignores the height limit..):</p>
  
  <p><a href="https://i.stack.imgur.com/o5kCv.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/o5kCv.jpg" alt="enter image description here"></a></p>
  
  <p>Here's the full XML:</p>
  
  <pre><code>&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/coordinatorLayout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/white"
  tools:context="com.mixtiles.android.reviewOrder.ReviewOrderActivity"
  tools:layout_editor_absoluteY="25dp"&gt;
  
  
  &lt;android.support.design.widget.AppBarLayout
      android:id="@+id/appBarLayout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/white"&gt;
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/review_order_toolbar"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:elevation="4dp"
              android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
              app:popupTheme="@style/ThemeOverlay.AppCompat.Light"&gt;
          &lt;/android.support.v7.widget.Toolbar&gt;
  &lt;/android.support.design.widget.AppBarLayout&gt;
  
  &lt;FrameLayout
      android:id="@+id/red"
      android:layout_width="0dp"
      android:layout_height="0dp"
      android:background="@color/red"
      app:layout_constraintBottom_toTopOf="@+id/green"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintHeight_max="300dp"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@+id/appBarLayout"
      app:layout_constraintVertical_chainStyle="spread_inside"&gt;
  
  &lt;/FrameLayout&gt;
  
  
  &lt;FrameLayout
      android:id="@+id/green"
      android:layout_width="0dp"
      android:layout_height="150dp"
      android:background="@color/greenish"
      app:layout_constraintBottom_toTopOf="@+id/pink"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@+id/red"&gt;
  
  &lt;/FrameLayout&gt;
  
  &lt;FrameLayout
      android:id="@+id/pink"
      android:layout_width="match_parent"
      android:layout_height="150dp"
      android:background="@color/pink"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@+id/green"&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p></p>