The difference between Android: src and android: background in android ImageView: imageviewandroid

Source: Internet
Author: User

The difference between Android: src and android: background in android ImageView: imageviewandroid

Http://www.androidren.com/index.php? Qa = 301 & qa_1 = differences between android-src and android-background in android imageview

There are several differences:

1. src is the foreground. Background is the background.

2. src is the display content, and background is the background.

3. background is an attribute of all views, while src is unique to ImageView. It is affected by android: scaleType, and the background is always scaled to the view size.

 

Appendix: More detailed scaleType description:

CENTER/center displays images in the view CENTER without scaling

CENTER_CROP/centerCrop scales the image proportionally so that the image length (width) is greater than or equal to the corresponding dimension of the view.

CENTER_INSIDE/centerInside scales the image proportionally so that the image length (width) is smaller than or equal to the corresponding dimension of the view.

FIT_CENTER/fitCenter scales the image proportionally to the smallest side of the view and is displayed in the center.

FIT_END/fitEnd scales the image proportionally to the smallest side of the view, which is displayed in the lower part of the view.

FIT_START/fitStart scales up or down an image proportionally to the smallest side of the view, which is displayed on the top of the view.

FIT_XY/fitXY: scale the image out of proportion to the view size.

MATRIX/matrix is drawn using a MATRIX.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.