/**
* 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;
}

ImageView 的 ScaleType的更多相关文章

  1. ImageView的ScaleType属性

    ImageView的ScaleType各种值代表的意义: CENTER:不进行任何缩放,将图片放在容器中间 CENTER_CROP:如果图片长宽都大于等于容器长宽,则图片不缩放,否则按固定长宽比缩放, ...

  2. ImageView的scaleType详解

    ImageView的ScaleType详 1. 网上的误解 不得不说很失望,到网上搜索了几篇帖子,然后看到的都是相互复制粘贴,就算不是粘贴的,有几篇还是只是拿着自己的几个简单例子,然后做测试,这种以一 ...

  3. Android ImageView的scaleType属性与adjustViewBounds属性(转)

    ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...

  4. Android课程---Android ImageView的scaleType属性与adjustViewBounds属性(转)

    ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...

  5. Android ImageView的scaleType属性与adjustViewBounds属性

    ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...

  6. Android ImageView的scaleType属性与adjustViewBounds属性(转载)

    ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...

  7. ImageView的Scaletype

    ImageView的Scaletype决定了图片在View上显示时的样子,如进行何种比例的缩放,及显示图片的整体还是部分,等等. 设置的方式包括: 1. 在layout xml中定义android:s ...

  8. Android摘要ImageView的scaleType属性

    Android在ImageView的scaleType有8一个选项 1 matrix不正确图像放大,原来自view在左上角绘制图片(片不变形): 2 fitXY将图片所有绘制到view中,可是图片会变 ...

  9. Android UI系列-----ImageView的scaleType属性

    这篇随笔将会简单的记录下ImageView这个控件的一些使用方法,以及其最重要的一个属性: scaleType ImageView这个控件是用来显示图片用的,例如我们可以通过下面这段xml配置来声明显 ...

  10. android中ImageView的ScaleType属性

    android中ImageView的ScaleType属性 ScaleType的值分别代表的意义: ImageView是Android中的基础图片显示控件,该控件有个重要的属性是ScaleType,该 ...

随机推荐

  1. Announcing the Release of ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1 for VS2012

    The NuGet packages for ASP.NET MVC 5.1, ASP.NET Web API 2.1 and ASP.NET Web Pages 3.1 are now live o ...

  2. Rest Web Api Controller 返回JSON格式大小写

    public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Ro ...

  3. 在sql查询中为了提高查询效率,我们常常会采取一些措施对查询语句进行sql优化,下面总结的一些方法,有需要的可以参考参考。

    转载https://www.cnblogs.com/zhang-bo/p/9138151.html 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建 ...

  4. C#中的线程(三)多线程

    C#中的线程(三)多线程   Keywords:C# 线程Source:http://www.albahari.com/threading/Author: Joe AlbahariTranslator ...

  5. @angular/cli项目构建--modal

    环境准备: cnpm install ngx-bootstrap-modal --save-dev impoerts: [BootstrapModalModule.forRoot({container ...

  6. @angular/cli项目构建--路由1

    app.module.ts import {BrowserModule} from '@angular/platform-browser'; import {NgModule} from '@angu ...

  7. 20165210 Java第九周学习总结

    20165210 Java第九周学习总结 教材学习内容 - 第十三章学习总结 URL类: URL的构造方法: try { URL url = new URL("http://www.goog ...

  8. Jenkins之构建触发器配置(转载)

    构建触发器配置,当你在文本框中输入配置的时间后,文本框下方会有时间解释,这样可以很好的看到自己配置的时间对不对. 可以清晰看到我的配置第一个运行时间是周五上午10点执行,第二次是星期六上午10点.   ...

  9. LeetCode Second Minimum Node In a Binary Tree

    原题链接在这里:https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/description/ 题目: Given a ...

  10. LeetCode Construct the Rectangle

    原题链接在这里:https://leetcode.com/problems/construct-the-rectangle/ 题目: For a web developer, it is very i ...