title: How to set the scale type programmatically
body: <p>I'm trying to set the scale type for an image through the <code>onBindViewHolder</code> method because the image looks way too stretched.  I had to comment out the last comment because I don't know how to use the <code>imageView.scaleType</code> method.</p>
  
  <pre><code>override fun onBindViewHolder(holder: PosterHolder, position: Int) {
      holder.view?.movie_poster?.setImageResource(R.drawable.beauty_and_the_beast_ver3)
      holder.view?.movie_poster?.scaleType = ImageView.ScaleType.FIT_CENTER
  }
  </code></pre>
  
  <p>I'm a beginner developer trying to learn Android with Kotlin.</p>
  
  <p><a href="https://i.stack.imgur.com/y9jOf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y9jOf.jpg" alt="This is the image"></a></p>
  
  <p>And this is what I'm getting on the emulator:</p>
  
  <p><a href="https://i.stack.imgur.com/W4xBe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W4xBe.png" alt="enter image description here"></a></p>