title: ConstraintLayout hides the last line of TextView with app:layout_constrainedHeight="true"
body: <p>I have noticed weird behavior of <code>ConstraintLayout</code> (version 1.1.3) that hides the last line of <code>TextView</code> whenever I try to use height with <code>wrap_content</code> property and <code>layout_constrainedHeight</code> is set to <code>true</code>.</p>
  
  <p>With <code>layout_constrainedHeight</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/ZcChR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ZcChR.png" alt="First image"></a></p>
  
  <p>With no <code>layout_constrainedHeight</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/lZO7T.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lZO7T.png" alt="Second image"></a></p>
  
  <p>Source code:</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"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;TextView
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_margin="16dp"
          android:text="Lorem..."
          app:layout_constrainedHeight="true"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>I thought that whenever I want to use <code>wrap_content</code> with <code>ConstraintLayout</code> I have to set <code>layout_constrainedHeight</code> to true, but this sometimes gives me weird bugs. Am I missing something?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>If I remove the margin around <code>TextView</code>, it works fine. It seems that <code>ConstraintLayout</code> does something wrong with <code>wrap_content</code> and margins.</p>