title: Make imageview resize to fit its container
body: <p>I use a relative layout to display a row in a listlayout. What I am showing is an imageview to the left and two textviews to the right. Both the textviews will only have a single line each.</p>
  
  <p>I need to have the image such that it should be automatically resize so its height becomes equal to the height of the text combined. That way, the image height will fit the combined height of both text in all screens. Is this possible? layout is as below -</p>
  
  <p></p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/note_img"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_alignParentBottom="true"
      android:layout_marginRight="6dip"
      android:src="@drawable/note_icon" /&gt;
  
  &lt;TextView android:id="@+id/text1" 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" 
      android:layout_toRightOf="@id/note_img"
      android:layout_alignParentRight="true" 
      android:layout_alignParentTop="true" 
      android:includeFontPadding="true"
      android:singleLine="true"
      style="@android:style/TextAppearance.Medium" /&gt;
  
  &lt;TextView android:id="@+id/text2"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content" 
      android:layout_toRightOf="@id/note_img"
      android:layout_alignParentBottom="true" 
      android:layout_below="@id/text1"
      android:singleLine="true"
      style="@android:style/TextAppearance.Small" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>As of now,note_img has a size of 96x96 and the image is shown in full size making the image area considerably large and the two text having huge gap between them.
  Really appreciate any help.</p>
  
  <p>Thanks,
  Arun</p>