Update:
The multiple device screen dimensions is a red herring - the problem is just that the image does not scale up properly to fill the screen - see comments on Ivan's answer.

I have a layout file with one image:

```
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/image"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:scaleType="centerCrop" />

```

Then I assign a drawable, which is small and must be scaled up:

```
setContentView(R.layout.image_story);
ImageView image = (ImageView)findViewById(R.id.image);
image.setImageDrawable(s.image);

```

Here is how it is rendered on two AVDs with different screen dimensions. These should be the same (detailed question at the bottom). Sorry for the large images.

with scaleType=centerCrop:

![](https://i.stack.imgur.com/3gkaN.png)
![](https://i.stack.imgur.com/G2jA7.png)

with centerInside

![](https://i.stack.imgur.com/5RlCu.png)
![](https://i.stack.imgur.com/zypLG.png)

AVDs:

![](https://i.stack.imgur.com/uQP9h.png)
![](https://i.stack.imgur.com/BO29h.png)

Edit:

With layout\_height="fill\_parent" and scaleType="centerInside"

![](https://i.stack.imgur.com/NQXVy.png)
![](https://i.stack.imgur.com/5hDDt.png)

I have a 2.1 AVD with the default values, so the screen is smaller, and this works exactly as expected- the image is scaled up to fill the width, and the view height is wrapped to the scaled height.

On my Droid Bionic with a longer screen, and on any AVD with the same screen dimensions, this doesn't work- the image is scaled to fill the width, but the view is wrapped to the **original** pre-scale image height, so the top and bottom are cropped off.

I have no idea why the device screen aspect ratio would have an effect on this. I've tried countless combination of layout parameters and scale types trying to get this to work on the Bionic. Everything works exactly as expected on the smaller screen, and not on the larger. If I set the image height explicitly in `dp`, it works as expected, but I never know what the dimensions of the image (or screen) will be. Any suggestions?