I need to place an image (a logo) on top of the android screen and I need it to be as wide as the entire screen and I need its' height to be proportional to the width, the same proportion as in the original image. So far, everything I've tried resulted in misproportioned images or images covering the entire screen. How do I fix this?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@color/blue">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/linearLayout"
android:layout_centerVertical="true"
>
<EditText
android:id="@+id/username"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginLeft="@dimen/margin_main"
android:layout_marginRight="@dimen/margin_main"
android:hint="@string/username"
android:textColorHint="#fff"
android:gravity="center"
android:background="@drawable/input_background"
android:layout_marginBottom="@dimen/margin_main"
android:textColor="#fff"
/>
<EditText
android:id="@+id/password"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:inputType="textPassword"
android:layout_marginLeft="@dimen/margin_main"
android:layout_marginRight="@dimen/margin_main"
android:hint="@string/password"
android:textColorHint="#fff"
android:gravity="center"
android:background="@drawable/input_background"
android:layout_marginBottom="@dimen/margin_main"
android:textColor="#fff"/>
<Button
android:id="@+id/login_button"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:text="@string/login"
android:layout_marginLeft="@dimen/margin_main"
android:layout_marginRight="@dimen/margin_main"
android:background="@drawable/button_yellow_background"
android:textStyle="bold"
android:textSize="20sp"
android:textColor="@color/blue"/>
</LinearLayout>
<ImageView
android:id="@+id/logo"
android:layout_width="315dp"
android:layout_height="100dp"
android:background="@drawable/logo"/>
</RelativeLayout>
The image in question is the logo.