title: ConstraintLayout relative distance in percentage %
body: <p>I am working with <code>ConstraintLayout</code> and I want to set a <strong>percentage</strong> margin top to the Textview Sample from the Button 2 placed at 52% of the screen.</p>
  
  <p>3% is of course compared to the height of the screen.</p>
  
  <blockquote>
    <p>The position should be relative from another UI components, guidelines reference only from the top (or bottom) of the screen</p>
  </blockquote>
  
  <p>It's possible to do this <strong>exclusively</strong> via xml?</p>
  
  <p>I know that is possibile to do this programmatically and with standard layouts with weight but I need (if exist) the XML solution.</p>
  
  <p><a href="https://i.stack.imgur.com/nRrDW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nRrDW.png" alt="View"></a>
  Code:</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.Guideline
          android:id="@+id/guideline"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
          app:layout_constraintGuide_percent="0.5" /&gt;
  
      &lt;Button
          android:id="@+id/button3"
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:layout_marginBottom="8dp"
          android:layout_marginTop="8dp"
          android:text="Button"
          app:layout_constraintBottom_toTopOf="@+id/guideline"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;TextView
          android:id="@+id/textView4"
          android:layout_width="wrap_content"
          android:layout_height="0dp"
          android:layout_marginTop="32dp"
          android:layout_weight="10"
          android:background="#00FF00"
          android:text="SAMPLE"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/button4" /&gt;
  
      &lt;Button
          android:id="@+id/button4"
          android:layout_width="wrap_content"
          android:layout_height="50dp"
          android:layout_marginTop="8dp"
          android:text="BUTTON 2"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_bias="0.5"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="@+id/guideline" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>