zoukankan      html  css  js  c++  java
  • ImageView 的 ScaleType

    
    
      /**
         * Options for scaling the bounds of an image to the bounds of this view.   将一个图片的边界缩放到这个view边界的几种选项
         */
        public enum ScaleType {
            /**
             * Scale using the image matrix when drawing. The image matrix can be set using 用指定的Matrix缩放
             * {@link ImageView#setImageMatrix(Matrix)}. From XML, use this syntax:
             * <code>android:scaleType="matrix"</code>.
             */
            MATRIX      (0),  
            /**
             * Scale the image using {@link Matrix.ScaleToFit#FILL}.         按照Matrix.ScaleToFit#FILL来缩放(填满)
             * From XML, use this syntax: <code>android:scaleType="fitXY"</code>.
             */
            FIT_XY      (1),
            /**
             * Scale the image using {@link Matrix.ScaleToFit#START}.        按照Matrix.ScaleToFit#Start来缩放(开始处对齐)
             * From XML, use this syntax: <code>android:scaleType="fitStart"</code>.
             */
            FIT_START   (2),
            /**
             * Scale the image using {@link Matrix.ScaleToFit#CENTER}.        按照Matrix.ScaleToFit#Center来缩放(中央对齐)
             * From XML, use this syntax:
             * <code>android:scaleType="fitCenter"</code>.
             */
            FIT_CENTER  (3),
            /**
             * Scale the image using {@link Matrix.ScaleToFit#END}.          按照Matrix.ScaleToFit#END来缩放(末尾对齐)
             * From XML, use this syntax: <code>android:scaleType="fitEnd"</code>.
             */
            FIT_END     (4),
            /**
             * Center the image in the view, but perform no scaling.          放在view的正中央,不缩放
             * From XML, use this syntax: <code>android:scaleType="center"</code>.
             */
            CENTER      (5),
            /** 均匀缩放图片(维持图片的宽高比)。让图片的宽和高都 >= view的宽和高(负padding)。图片之后被放在view的中央。CENTER_CROP就是放在中央,看起来图片缩放之后多余的被view裁掉了
             * Scale the image uniformly (maintain the image's aspect ratio) so
             * that both dimensions (width and height) of the image will be equal
             * to or larger than the corresponding dimension of the view
             * (minus padding). The image is then centered in the view.
             * From XML, use this syntax: <code>android:scaleType="centerCrop"</code>.
             */
            CENTER_CROP (6),
            /** 均匀缩放图片(维持图片的宽高比)。让图片的宽和高都 <= view的宽和高(负padding)。图片之后被放在view的中央。CENTER_INSIDE就是放在中央,图片缩放后不许超过view的边界
             * Scale the image uniformly (maintain the image's aspect ratio) so
             * that both dimensions (width and height) of the image will be equal
             * to or less than the corresponding dimension of the view
             * (minus padding). The image is then centered in the view.
             * From XML, use this syntax: <code>android:scaleType="centerInside"</code>.
             */
            CENTER_INSIDE (7);
            
            ScaleType(int ni) {
                nativeInt = ni;
            }
            final int nativeInt;
        }
  • 相关阅读:
    重磅官宣:Nacos2.0发布,性能提升10倍
    埃森哲携手阿里云共建基于云原生的消费者运营中台解决方案
    3. Windows根据端口查进程---ADB 相关报错 ADB server didn't ACK cannot bind ':5037'
    2.Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running
    1.运行Android Studio,一直提示:Error running app: Instant Run requires 'Tools | Android | Enable ADB integration' to be enabled.
    SpringBoot_配置-yaml配置文件值获取
    SpringBoot_入门-使用向导快速创建Spring Boot应用
    SpringBoot_入门-HelloWorld细节-自动配置
    SpringBoot_入门-微服务简介
    SpringBoot_入门-Spring Boot简介
  • 原文地址:https://www.cnblogs.com/maxiaodoubao/p/4680397.html
Copyright © 2011-2022 走看看