Question: I have an ImageView.  

I set it in xml as below:　

```
<ImageView
    android:id="@+id/background"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

```

And set image as below: 

```
ImageView background
background.setImageBitmap(bitmap);

```

But if the ImageView's parent layout narrow down, the IamgeView also narrow down.  

And the image was resized.  

I want to let it don't resize.  

Is it can modify by setScaleType?  

Or how to do it?

Answer: 
Try setting [adjustViewBounds](http://developer.android.com/reference/android/widget/ImageView.html#attr_android:adjustViewBounds) parameter to true on the ImageView.

```
<ImageView
   android:id="@+id/background"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content" 
   android:adjustViewBounds="true"/>

```
Why don't you use `scaledBitmap` like this

```
Bitmap bMap =   Bitmap.createScaledBitmap(chosenBitmap, needed_width, needed_height, true);
imageView.setImageBitmap(bMap);

```