title: Why does NOT my ImageView change its ScaleType programmatically?
body: <p>I have an <code>ImageView</code> called <code>"alumniImage"</code> which I set it programmatically to <code>ScaleType</code> of <code>CENTERCROP</code>.</p>
  
  <p>But in the app it doesn't seem to change.</p>
  
  <p>Here is the code for it:</p>
  
  <pre><code>    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);
  </code></pre>
  
  <p>I tried to use the debugger and nothing changed.</p>
  
  <p>Here is a screen shot:</p>
  
  <p><a href="https://i.stack.imgur.com/gI2HY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gI2HY.png" alt="enter image description here"></a></p>
  
  <p>Why is this happening?!</p>
  
  <p>BTW I tried to put that <code>ImageView</code> in an xml file and it worked fine.</p>
  
  <p>Thanks In Advance.</p>