How do I make a picture stretch in Imnageview in Android?

Source: Internet
Author: User

 Supplemental: 
The properties of the ScaleType are matrix (default), center, Centercrop, Centerinside, Fitcenter, Fitend, Fitstart, Fitxy.
Android:scaletype= Center
maintains the size of the original image, which is displayed in the center of the ImageView. When the size of the original image is larger than the size of ImageView, the partial cropping is exceeded.

android:scaletype= "Centercrop"
to fill the entire ImageView, the center of the original image is aligned to the center of the ImageView, and so on to enlarge the original image, Until the ImageView is filled (refers to the width and height of the ImageView to fill), the original image over the ImageView part for cutting. The

android:scaletype= "Centerinside"
Displays the contents of the picture in its entirety, centered on the original, by proportionally reducing the size width (height) of the original image to be equal to or less than the width of the ImageView (high). If the size of the original is smaller than the size of ImageView, the size of the original is not processed and centered on the ImageView.

android:scaletype= "Matrix"
does not change the size of the original, starting from the upper left corner of the ImageView to draw the original image, the original more than the ImageView part of the crop.

android:scaletype= "Fitcenter"
enlarges or shrinks the original image to the height of the ImageView imageview, centered

Android:scaletype= Fitend "
Enlarges (shrinks) the original image to the height of the ImageView, displayed in the lower part of the ImageView

android:scaletype=" Fitstart "
to enlarge (zoom out) the original artwork proportionally To the height of the ImageView, displayed in the upper part of the ImageView

android:scaletype= "Fitxy"
Displays the original artwork in view at the specified size, stretches the display picture, does not maintain the original proportions, Fill ImageView.

How do I make a picture stretch in Imnageview in Android?

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.