title: Why do I need to wrap an ImageView into a FrameLayout?
body: <p>Here is a simple layout: </p>
  
  <pre><code>      &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;ImageView
                  android:id="@+id/companyIcon"
                  android:layout_width="wrap_content"
                  android:layout_height="40dp" &lt;!-- notice I've limited a height --&gt;
                  android:scaleType="fitStart"
                  android:adjustViewBounds="true"
                  android:layout_alignParentLeft="true" /&gt;
  
              &lt;TextView
                  android:id="@+id/companyName"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_toRightOf="@id/companyIcon"
                  android:layout_marginLeft="3dp"
                  android:layout_centerVertical="true"
                  android:textStyle="bold"
                  android:textColor="#20526d" /&gt;
          &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The height of an image I will set by <code>setImageBitmap()</code> is more that 40dp. 
  Using this layout I have an extra space between <code>ImageView</code> and <code>TextView</code>, where did it come from? 
  <img src="https://i.stack.imgur.com/XZb0Q.png" alt="enter image description here"></p>
  
  <p>But after I wrap the <code>ImageView</code> with <code>FrameLayout</code> I don't have this unnecessary extra space:</p>
  
  <pre><code>&lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"&gt;
  
              &lt;FrameLayout
                  android:id="@+id/image_container"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"&gt;
  
                  &lt;ImageView
                      android:id="@+id/companyIcon"
                      android:layout_width="wrap_content"
                      android:layout_height="40dp"
                      android:scaleType="fitStart"
                      android:adjustViewBounds="true"
                      android:layout_alignParentLeft="true" /&gt;
              &lt;/FrameLayout&gt;
  
              &lt;TextView
                  android:id="@+id/companyName"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_toRightOf="@id/image_container"
                  android:layout_marginLeft="3dp"
                  android:layout_centerVertical="true"
                  android:textStyle="bold"
                  android:textColor="#20526d" /&gt;
          &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And the result:</p>
  
  <p><img src="https://i.stack.imgur.com/d4Hv3.png" alt="enter image description here"></p>
  
  <p>Can you guys explain why shall I put <code>ImageView</code> into <code>FrameLayout</code> to have things as intended? Thank you very much.</p>