Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

android - What is the difference between src and background of ImageView

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...