I have a background image that I would like to 1) fill the vertical space, regardless of whether the image's width is greater than the width of the parent, and 2) align the right edge of the image with the right edge of the parent.

Currently scaleType="centerCrop" is giving me (1) but not (2); it centers the image horizontally. Does anyone know how to get it to right-align? Thanks!

EDIT: Tried adding android:layout\_alignParentRight="true" to both the relative layout and image view, with no effect.

```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_gravity="center" >

    <ImageView android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:scaleType="centerCrop"
    android:src="@drawable/bg"/>

    <LinearLayout
    android:id="@+id/fg"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

        ...

```