title: Using layout_weight with ImageView in LinearLayout
body: <p>I am trying to place an ImageView in the middle of the screen, with the aim of putting other views above and below it so I have decided to use a LinearLayout (vertical) and a LinearLayout (horizontal). However, when I use layout_weight for the ImageView, the image disappears completely (a blank screen is shown). The ImageView's image is set in onCreate(). I would like the ImageView to take up 50% of the width of the screen, hence my use of weights.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent" android:orientation="vertical"&gt;
  
  &lt;View
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_weight="1"/&gt;
  
  &lt;LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:orientation="horizontal"
  android:layout_weight="2"&gt;
  
  &lt;View android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_weight="1"/&gt;
  
      &lt;ImageView android:layout_weight="2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/albumArtImageView"&gt;&lt;/ImageView&gt;
  
      &lt;View android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_weight="1"/&gt;
  
  &lt;/LinearLayout&gt;
  &lt;View
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_weight="1"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>