What is the difference between src and background of ImageView

peter_feng picture peter_feng · Mar 28, 2011 · Viewed 32.2k times · Source

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

I know the former means the content of this ImageView and the latter means the background of the ImageView.

But how to decide which one to use? I don't see the difference.

Answer

Matthew Willis picture Matthew Willis · Mar 28, 2011

All views can take a background image.

The src to an ImageView has additional features:

  • different scaling types
  • adjustViewBounds for setting bounds to match image dimensions
  • some transformations such as alpha-setting

And more that you may find in the docs.