Android Summary: The scaleType attribute of ImageView, imageviewscaletype

Source: Internet
Author: User

Android Summary: The scaleType attribute of ImageView, imageviewscaletype

In Android, The scaleType of ImageView has eight options.

1 matrix does not scale the image, and draws the image from the upper left corner of the view (the image is not deformed );

2. fitXY draws all the images to the view, but the images are deformed. (The picture is deformed and full of views)

3 fitStart, fitCenter, and fitEnd attributes use the longer side of the image as the benchmark to scale the image. Because of this, the image will not be fully filled with views, the difference is that the anchor points drawn by the image in the view are different. (The image is not deformed and cannot be filled with the view)

4. The center does not scale the image. Select the center of the view and image to draw the image. (The image is not deformed)

5. centerCrop ensures that the image is full of views. Therefore, the shorter side of the image is selected as the benchmark for scaling. (The image is not deformed and full of views)

6 centerInside ensures that the image is displayed in the middle of the view. When the image is larger than the view, the longer side of the image is selected as the reference to narrow down the image. When the width and height of the image are smaller than the view, directly display the image in the middle of the view. (Images are not deformed)

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.