Usage analysis of scaletype attribute of ImageView in Android Development

This article describes the use of the scaletype attribute of ImageView in Android development. Share with you for your reference, as follows:

The property of ImageView is Android: scaletype, i.e. ImageView setScaleType(ImageView.ScaleType)。 Android: scaletype controls how images are resized / moved to match the size of ImageView. ImageView. Scaletype / Android: the meaning difference of scaletype value:

Center / center is displayed in the center according to the original size of the picture. When the length / width of the picture exceeds the length / width of view, the middle part of the picture will be intercepted for display

CENTER_ Crop / centercrop enlarges the size of the picture in proportion to the center display, so that the length (width) of the picture is equal to or greater than the length (width) of the view

CENTER_ Inside / centerinside displays the contents of the picture completely in the center. By scaling down or the original size, the length / width of the picture is equal to or less than the length / width of the view

FIT_ Center / fitcenter enlarges / reduces the picture to the width of the view in proportion and displays it in the middle

FIT_ End / fitend enlarges / reduces the picture to the width of the view and displays it in the lower part of the view

FIT_ Start / fitstart enlarges / reduces the picture to the width of the view and displays it in the upper part of the view

FIT_ XY / fitxy expands / reduces the picture out of scale to the size of the view

Matrix / matrix is drawn with a matrix

At the beginning, I didn't understand matrix. After online search, I found that the original matrix can be displayed by dynamically reducing and enlarging the picture. Instead of in-depth understanding, I just posted relevant statements to reduce the picture:

For more Android related content, readers who are interested can view the special topics of this site: summary of Android graphics and image processing skills, summary of Android photography and image processing skills, summary of activity operation skills of Android programming, summary of Android view skills, summary of Android operation skills of SQLite database Summary of Android operating JSON format data skills, summary of Android database operating skills, summary of Android file operating skills, summary of SD card operating methods for Android programming development, introduction and advanced tutorial for Android development, summary of Android resource operating skills, and summary of Android control usage

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>