title: How to make icon the same size as text in Android?
body: <p>I have TextView with some text and ImageView with some icon. I aligned them by baseline:</p>
  <pre><code>android:baselineAlignBottom=&quot;true&quot;
  app:layout_constraintBaseline_toBaselineOf=&quot;@+id/penny&quot;
  </code></pre>
  <p>TextView has some text size, but I can't guess the height of ImageView so that the text (not TextView) and the icon are the same height, they are always slightly different. How I can fix it?<a href="https://i.stack.imgur.com/Boo8H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Boo8H.png" alt="enter image description here" /></a></p>
  <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout ... &gt;
  &lt;TextView
      android:id=&quot;@+id/text&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:textSize=&quot;16sp&quot;
      app:layout_constraintTop_toTopOf=&quot;parent&quot;
      app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;
  
  &lt;ImageView
      android:id=&quot;@+id/icon&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;12dp&quot;
      android:baselineAlignBottom=&quot;true&quot;
      app:layout_constraintBaseline_toBaselineOf=&quot;@+id/text&quot;
      app:layout_constraintStart_toEndOf=&quot;@+id/text&quot;
      android:src=&quot;@drawable/icon&quot; /&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>