title: android ImageView: Place image on top
body: <p>I have an activity containing only one <code>ImageView</code>. This view should display an image loaded from an URL. I want, that this image will be shown on the top of my screen using the whole screen width.
  My layout-file:</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"
          android:background="@color/overview_bgColor" &gt;
          &lt;ImageView 
              android:id="@+id/overview_image"
              android:contentDescription="image"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="top|fill_horizontal"/&gt;
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>But the image is always shown vertically centered. But why? I thought, that <code>top</code> will place this <code>ImageView</code> on top of my screen?</p>