ImageView use of Scaletype property

ImageView of Scaletype determines the way when the picture is displayed on the View, such as what percentage of the scaled and displayed in whole or in part of the picture, and so on.
 
1. SetScaleType(ImageView.ScaleType.CENTER);
 
    According to the original image size centered, when the image length / width than View length / width, the center part of the image display interception
 
2. SetScaleType(ImageView.ScaleType.CENTER_CROP);
 
    Scaled image size is centered, so that the image length (width) is equal to or greater than the length of View (width)
 
3. setScaleType(ImageView.ScaleType.CENTER_INSIDE);
 
    The contents of the complete image is displayed centrally, or by scaling down the size of the original image such that the length / width equal to or smaller than View length / width
 
4. setScaleType(ImageView.ScaleType.FIT_CENTER);
 
    The picture scaled up / down to View width, centered
 
5. FIT_START, FIT_END FIT_CENTER with zoom effect as in the image, but the display of different positions, FIT_START is placed at the top, middle FIT_CENTER, FIT_END the bottom.
 
    In the example given here is not.
6. FIT_XY
    Not scaled picture, the goal is to fill up the whole picture View. [Common]

Reproduced in: https: //my.oschina.net/dminter/blog/205017

Guess you like

Origin blog.csdn.net/weixin_34360651/article/details/91888780