• 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;
        }
  • 相关阅读:
    超级干货;Python优化之使用pandas读取和训练千万级数据
    「git」mac下git提交github代码
    「Linux+Django」uwsgi服务启动(start)停止(stop)重新装载(reload)
    「Linux+Django」Django+CentOs7+uwsgi+nginx部署网站记录
    「Linux」centos7安装mysql
    「Linux」centos7安装使用rar
    「Linux」centos7安装uWSGI
    「Linux」centos7更新python3.6后yum报错问题
    「Linux」centos7安装python
    「Linux」VMware安装centos7(一)
  • 原文地址:https://www.cnblogs.com/maxiaodoubao/p/4680397.html
Copyright © 2020-2023  润新知