I have an `ImageView` called `"alumniImage"` which I set it programmatically to `ScaleType` of `CENTERCROP`.

But in the app it doesn't seem to change.

Here is the code for it:

```
    LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams(
(int) getResources().getDimension(R.dimen.survey_height), // 50dp
ViewGroup.LayoutParams.MATCH_PARENT);

    ImageView alumniImage = new ImageView(getContext()); //because I am in a fragment
    alumniImage.setLayoutParams(imageParams);
    alumniImage.setImageResource(R.drawable.alumni_survey);
    alumniImage.setScaleType(ImageView.ScaleType.CENTER_CROP);
    alumniLayout.addView(alumniImage);

```

I tried to use the debugger and nothing changed.

Here is a screen shot:

[![enter image description here](https://i.stack.imgur.com/gI2HY.png)](https://i.stack.imgur.com/gI2HY.png)

Why is this happening?!

BTW I tried to put that `ImageView` in an xml file and it worked fine.

Thanks In Advance.