title: Is it possible to to define all my layout only with constraints?
body: <p>I am trying to define the height of the constraintLayout1 30% of the available size. And the remaining for the constraintLayout2. But I want to define percentage not pixels.
  The Button1 should be 50% with and the button2 the others 50%.
  I want to define everything with constraints and not with fix values (as I am doing now <code>marginBottom="500dp</code>).
  Is this possible to do in any way? I am using Android 3.6.2.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.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"
      tools:context=".MainActivity"&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id="@+id/constraintLayout1"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:layout_marginBottom="500dp"
          android:background="#E91E63"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintVertical_bias="0.0"&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id="@+id/constraintLayout2"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:background="#8BC34A"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/constraintLayout1"
          app:layout_constraintVertical_bias="0.0"&gt;
  
          &lt;Button
              android:id="@+id/button1"
              android:layout_width="wrap_content"
              android:layout_height="0dp"
              android:text="Button"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
          &lt;Button
              android:id="@+id/button2"
              android:layout_width="wrap_content"
              android:layout_height="0dp"
              android:text="Button"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  ```[enter image description here][1]
  
  
    [1]: https://i.stack.imgur.com/NzZwz.png
  </code></pre>