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;
}
ImageView 的 ScaleType的更多相关文章
- ImageView的ScaleType属性
ImageView的ScaleType各种值代表的意义: CENTER:不进行任何缩放,将图片放在容器中间 CENTER_CROP:如果图片长宽都大于等于容器长宽,则图片不缩放,否则按固定长宽比缩放, ...
- ImageView的scaleType详解
ImageView的ScaleType详 1. 网上的误解 不得不说很失望,到网上搜索了几篇帖子,然后看到的都是相互复制粘贴,就算不是粘贴的,有几篇还是只是拿着自己的几个简单例子,然后做测试,这种以一 ...
- Android ImageView的scaleType属性与adjustViewBounds属性(转)
ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...
- Android课程---Android ImageView的scaleType属性与adjustViewBounds属性(转)
ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...
- Android ImageView的scaleType属性与adjustViewBounds属性
ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...
- Android ImageView的scaleType属性与adjustViewBounds属性(转载)
ImageView的scaleType的属性有好几种,分别是matrix(默认).center.centerCrop.centerInside.fitCenter.fitEnd.fitStart.fi ...
- ImageView的Scaletype
ImageView的Scaletype决定了图片在View上显示时的样子,如进行何种比例的缩放,及显示图片的整体还是部分,等等. 设置的方式包括: 1. 在layout xml中定义android:s ...
- Android摘要ImageView的scaleType属性
Android在ImageView的scaleType有8一个选项 1 matrix不正确图像放大,原来自view在左上角绘制图片(片不变形): 2 fitXY将图片所有绘制到view中,可是图片会变 ...
- Android UI系列-----ImageView的scaleType属性
这篇随笔将会简单的记录下ImageView这个控件的一些使用方法,以及其最重要的一个属性: scaleType ImageView这个控件是用来显示图片用的,例如我们可以通过下面这段xml配置来声明显 ...
- android中ImageView的ScaleType属性
android中ImageView的ScaleType属性 ScaleType的值分别代表的意义: ImageView是Android中的基础图片显示控件,该控件有个重要的属性是ScaleType,该 ...
随机推荐
- Redis简介 & 与Memcache的区别
redis 是一个基于内存的高性能key-value数据库. Reids的特点 Redis本质上是一个Key-Value类型的内存数据库,很像memcached,整个数据库统统加载在内存当中进行操 ...
- Tomcat的bin目录下startup.bat、Tomcat6.exe、Tomcat6w.exe区别
从官方下载了apache-tomcat-6.0.37-windows-x64.zip安装包,解压后bin目录下的startup.bat.Tomcat6.exe.Tomcat6w.exe 3个程序有何区 ...
- node中的加密模块 crypto
crypto 加密模块(不是很安全):是使用md5来加密,这是node自带的模块,不需要安装. 引入模块: const crypto = require('crypto'); 当用户注册时,我们将从前 ...
- Linux tar命令总结
压缩 tar –cvf jpg.tar *.jpg 将目录里所有jpg文件打包成tar.jpg tar –czf jpg.tar.gz *.jpg 将目录里所有jpg文件打包成jpg.tar后, ...
- SpringBoot_07_Springboot test 使用mockito进行web测试
一.前言 使用mockito测试框架可以方便的进行web测试 二.用法实例 package com.ray.weixin.qy.controller; import com.ray.weixin.qy ...
- 条款42:了解typename的双重含义
typename在很多种情况下与class是完全相同的,例如下面的使用: templame<typename T> ...... template<class T> ..... ...
- stl_algobase.h
stl_algobase.h // Filename: stl_algobase.h // Comment By: 凝霜 // E-mail: mdl2009@vip.qq.com // Blog: ...
- mysql 在Windows下自动备份
1.一般备份方法主要为两种: 直接保存数据库data文件夹 mysqldump 用sql命令备份(文件存放目录必须存在) 首先cmd进入MySQL\bin,然后mysqldump --default- ...
- 康托展开与逆康托展开模板(O(n^2)/O(nlogn))
O(n2)方法: namespace Cantor { ; int fac[N]; void init() { fac[]=; ; i<N; ++i)fac[i]=fac[i-]*i; } in ...
- CodeForces - 688C:NP-Hard Problem (二分图&带权并查集)
Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex c ...