title: ConstraintLayout Vertical Chain Weight
body: <h2>The Problem</h2>
  
  <hr>
  
  <p>I have simple calculator layout to test constraint layout. I have already achieved to create this layout: <a href="https://i.stack.imgur.com/vINfr.png" rel="nofollow noreferrer">BasicLayout</a> However the problem with this layout is, that there is empty space on the button. So I want to create a vertical chaing with weights to fill the complete screen.</p>
  
  <h2>What I tried</h2>
  
  <hr>
  
  <p>So I came up with this layout: (See Edit)</p>
  
  <p>However the result is not what I want, instead it produces this layout: <a href="https://i.stack.imgur.com/QUbP5.png" rel="nofollow noreferrer">My Try</a></p>
  
  <p>So somehow it ignores the vertical weights. Anyone an idea how to fix it ?</p>
  
  <h2>Edit</h2>
  
  <hr>
  
  <p>After some time I achieved this <a href="https://i.stack.imgur.com/h4WZv.png" rel="nofollow noreferrer">Closer</a>, which is closer but the weight still changes nothing: 
  New Code: </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/activity_main"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  
      &lt;View
          android:id="@+id/test"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/colorPrimary"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintVertical_weight="5"
          app:layout_constraintBottom_toTopOf="@+id/btn_space"
           /&gt;
  
  
  
  
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_space"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text=""
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="3"
          app:layout_constraintVertical_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toLeftOf="@+id/button155"
          app:layout_constraintTop_toBottomOf="@+id/test"
          app:layout_constraintBottom_toTopOf="@+id/btn_13"
       /&gt;
  
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/button155"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="AC"
          android:textSize="20dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_space"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_space"
          app:layout_constraintRight_toLeftOf="@+id/btn_clr" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_clr"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="CLR"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/button155"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/button155"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/button155" /&gt;
  
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_13"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="13"
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toLeftOf="@+id/btn_14"
          app:layout_constraintTop_toBottomOf="@+id/test"
          app:layout_constraintBottom_toTopOf="@+id/btn_10" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_14"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="14"
          android:textSize="30dp"
          app:layout_constraintTop_toTopOf="@+id/btn_13"
          app:layout_constraintBottom_toBottomOf="@+id/btn_13"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_13"
          app:layout_constraintRight_toLeftOf="@+id/btn_15" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_15"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="15"
          android:textSize="30dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_13"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintTop_toTopOf="@+id/btn_13"
          app:layout_constraintBottom_toBottomOf="@+id/btn_13"
          app:layout_constraintLeft_toRightOf="@+id/btn_14"
          app:layout_constraintRight_toLeftOf="@+id/btn_very_good" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_very_good"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="Sehr Gut"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/btn_13"
          app:layout_constraintHorizontal_weight="2"
          app:layout_constraintLeft_toRightOf="@+id/btn_15"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/btn_13" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_10"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="10"
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintVertical_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toLeftOf="@+id/btn_11"
          app:layout_constraintTop_toBottomOf="@+id/btn_13"
          app:layout_constraintBottom_toTopOf="@+id/btn_7" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_11"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="11"
          android:textSize="30dp"
          app:layout_constraintTop_toTopOf="@+id/btn_10"
          app:layout_constraintBottom_toBottomOf="@+id/btn_10"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_10"
          app:layout_constraintRight_toLeftOf="@+id/btn_12" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_12"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="12"
          android:textSize="30dp"
          app:layout_constraintTop_toTopOf="@+id/btn_10"
          app:layout_constraintBottom_toBottomOf="@+id/btn_10"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_11"
          app:layout_constraintRight_toLeftOf="@+id/btn_good" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_good"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="Gut"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/btn_10"
          app:layout_constraintHorizontal_weight="2"
          app:layout_constraintLeft_toRightOf="@+id/btn_12"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/btn_10" /&gt;
  
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_7"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="7"
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintVertical_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toLeftOf="@+id/btn_8"
          app:layout_constraintTop_toBottomOf="@+id/btn_10"
          app:layout_constraintBottom_toTopOf="@+id/btn_4" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_8"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="8"
          android:textSize="30dp"
          app:layout_constraintTop_toTopOf="@+id/btn_7"
          app:layout_constraintBottom_toBottomOf="@+id/btn_7"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_7"
          app:layout_constraintRight_toLeftOf="@+id/btn_9" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_9"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="9"
          android:textSize="30dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_7"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_8"
          app:layout_constraintRight_toLeftOf="@+id/btn_satisfying" /&gt;
  
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_satisfying"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="Befriedigend"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/btn_7"
          app:layout_constraintHorizontal_weight="2"
          app:layout_constraintLeft_toRightOf="@+id/btn_9"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/btn_7" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_4"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="4"
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintVertical_weight="1"
          app:layout_constraintRight_toLeftOf="@+id/btn_5"
          app:layout_constraintTop_toBottomOf="@+id/btn_7"
          app:layout_constraintBottom_toTopOf="@+id/btn_1" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_5"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="5"
          android:textSize="30dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_4"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_4"
          app:layout_constraintRight_toLeftOf="@+id/btn_6" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_6"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="6"
          android:textSize="30dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_4"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_5"
          app:layout_constraintRight_toLeftOf="@+id/txt_sufficient" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/txt_sufficient"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="Ausreichend"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/btn_4"
          app:layout_constraintHorizontal_weight="2"
          app:layout_constraintLeft_toRightOf="@+id/btn_6"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/btn_4" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_1"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="1"
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintVertical_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toLeftOf="@+id/btn_2"
          app:layout_constraintTop_toBottomOf="@+id/btn_4"
          app:layout_constraintBottom_toTopOf="@+id/view_space_before_btn_0" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_2"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="2"
          android:textSize="30dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_1"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_1"
          app:layout_constraintRight_toLeftOf="@+id/btn_3" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_3"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="3"
          android:textSize="30dp"
          app:layout_constraintBaseline_toBaselineOf="@+id/btn_1"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_2"
          app:layout_constraintRight_toLeftOf="@+id/txt_inadequate" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/txt_inadequate"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="Mangelhaft"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/btn_1"
          app:layout_constraintHorizontal_weight="2"
          app:layout_constraintLeft_toRightOf="@+id/btn_3"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/btn_1" /&gt;
  
  
      &lt;View
          android:id="@+id/view_space_before_btn_0"
          android:layout_width="0dp"
          android:layout_height="30dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="1"
          android:textSize="30dp"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toLeftOf="@+id/btn_0"
          app:layout_constraintVertical_weight="1"
          app:layout_constraintTop_toBottomOf="@+id/btn_1"
          app:layout_constraintBottom_toBottomOf="parent"
         /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_0"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="0"
          android:textSize="30dp"
          app:layout_constraintBottom_toBottomOf="@+id/view_space_before_btn_0"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/view_space_before_btn_0"
          app:layout_constraintRight_toLeftOf="@+id/btn_result" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/btn_result"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="="
          android:textSize="30dp"
          app:layout_constraintBottom_toBottomOf="@+id/view_space_before_btn_0"
          app:layout_constraintHorizontal_weight="1"
          app:layout_constraintLeft_toRightOf="@+id/btn_0"
          app:layout_constraintRight_toLeftOf="@+id/txt_insufficient" /&gt;
  
      &lt;com.envidual.gradecalculator.TextViewRoboto
          android:id="@+id/txt_insufficient"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="?attr/selectableItemBackgroundBorderless"
          android:gravity="center"
          android:text="Ungenügend"
          android:textSize="20sp"
          app:layout_constraintBottom_toBottomOf="@+id/btn_0"
          app:layout_constraintHorizontal_weight="2"
          app:layout_constraintLeft_toRightOf="@+id/btn_result"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="@+id/btn_0" /&gt;
  </code></pre>
  
  <p></p>