What is the difference between src and background of ImageView

前端 未结 4 1742
[愿得一人]
[愿得一人] 2020-11-28 06:03

I am a puzzled about using src or background for an ImageView.

I know the former means the content of this ImageView

4条回答
  •  余生分开走
    2020-11-28 06:26

    1. when you use android:background, image will be set to fit on ImageView area(i.e according to width and height of ImageView). It doesn't matter if the image is smaller or larger than ImageView.

    2. when you use android:src, then image will display in its original size. No automatic scaling, adjustments will happen.

提交回复
热议问题