- 浏览: 313012 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (107)
- Linux (16)
- Android (20)
- Network Pay (0)
- UI (8)
- Program Language (13)
- Java (8)
- Web Design (3)
- Database (5)
- SQLite (2)
- Vi/Vim (4)
- CSS (2)
- Network (3)
- PHP (20)
- Web Service (3)
- Troubleshooting (37)
- MySQL (3)
- System Management (3)
- Tools (27)
- Others (7)
- Eclipse (3)
- Framework (5)
- Python (1)
- JavaScript (1)
- Git (1)
- SCM (1)
- Video (0)
- Testing (0)
- Windows (1)
- http://service.oray.com/question/116.html (1)
- Python Troubleshooting (1)
最新评论
-
xwv:
能对你有启发和帮助就好
为什么Android的Adapter中,bindview被调用了多次 -
lipei.98:
哈哈 谢谢你的博客,解决了我一个头痛的问题。
为什么Android的Adapter中,bindview被调用了多次
对于Android的widget: ImageView,其方法setScaleType()可以设置其Scale Type.
之前对于其可以使用的Scale Type究竟有哪些,并不清楚.
下面的blog是通过Google找着的,通过示例说明了在类ImageView.ScaleType中定义的一些Scale Type.
[Android] ImageView.ScaleType设置图解
此blog中说明的Scale Type共有7种.
当然,去Android的开发者网站浏览文档,可以得到更细致的信息.
1.http://developer.android.com/reference/android/widget/ImageView.ScaleType.html
此处说明的Scale Type共有8种.下面的内容是其转摘.
public static final ImageView.ScaleType CENTER
Center the image in the view, but perform no scaling.
From XML, use this syntax: android:scaleType="center"
.
public static final ImageView.ScaleType CENTER_CROP
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: android:scaleType="centerCrop"
.
public static final ImageView.ScaleType CENTER_INSIDE
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: android:scaleType="centerInside"
.
public static final ImageView.ScaleType FIT_CENTER
Scale the image using CENTER
.
From XML, use this syntax:
android:scaleType="fitCenter"
.
public static final ImageView.ScaleType FIT_END
Scale the image using END
.
From XML, use this syntax: android:scaleType="fitEnd"
.
public static final ImageView.ScaleType FIT_START
Scale the image using START
.
From XML, use this syntax: android:scaleType="fitStart"
.
public static final ImageView.ScaleType FIT_XY
Scale the image using FILL
.
From XML, use this syntax: android:scaleType="fitXY"
.
public static final ImageView.ScaleType MATRIX
Scale using the image matrix when drawing. The image matrix can be set using
setImageMatrix(Matrix)
. From XML, use this syntax:
android:scaleType="matrix"
.
对于其中的FIT_CENTER,FIT_END,FIT_START,FIT_XY,它们的Scale 方式说明在下面的web中
进行了说明:
http://developer.android.com/reference/android/graphics/Matrix.ScaleToFit.html#CENTER
下面对其说明内容进行了转摘:
public static final Matrix.ScaleToFit CENTER
Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. The result is centered inside dst.
public static final Matrix.ScaleToFit END
Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. END aligns the result to the right and bottom edges of dst.
public static final Matrix.ScaleToFit FILL
Scale in X and Y independently, so that src matches dst exactly. This may change the aspect ratio of the src.
public static final Matrix.ScaleToFit START
Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. START aligns the result to the left and top edges of dst.
发表评论
-
在Android项目中使用库项目的一些参考资料
2013-02-17 14:23 01.使用库项目实现Android程序代码的复用 2.An ... -
在Samsung Galaxy S3 GT-I9300获取root权限
2012-10-26 18:23 2450如题,怎么做? 之前在一部And ... -
Android中使用XML
2012-10-11 17:03 0在 Android 应用程序中使用 Internet 数据: ... -
Android应用中实现一个软件启动的欢迎界面
2012-07-31 21:03 3678在一个Android应用启动时,可以根据需要为其设 ... -
给Android手机设置的壁纸应该是多大尺寸
2012-07-30 18:15 7706如果在Android手机中设置一个新的壁纸,那么这 ... -
【转】各种浏览器的页面渲染引擎简介
2012-07-12 15:42 861一直对各种浏览的页面渲染引擎不是很清楚,今天看到一 ... -
【转】一篇关于工具tcpdump使用的文章
2012-05-29 18:17 851因为测试需要,在Android手机中使用了工具tc ... -
apache的htttpget对url长度的限制
2012-05-29 11:45 0Get方法提交URL的最大长度限制 http://s ... -
升级Android ADT后,为何编译项目未能生成apk文件
2012-05-29 11:26 3068最近升级了Android SDK Tools,Pl ... -
关于Android中的uses-permission和uses-feature
2012-04-25 15:26 2524前些天,看到一篇blog: ... -
Android设计中和“singleTask“有关的一个设计问题
2012-04-23 16:16 3809在Android设计中 ... -
Android的log里这代表什么:Activity idle timeout for HistoryRecord
2012-04-16 12:26 13238测试Android程序时,在logcat中见到类似 ... -
两篇关于Android App Widgets 的文章
2012-04-13 16:24 1005在开发中遇到和Android App Widget ... -
为什么Android的Adapter中,bindview被调用了多次
2012-04-10 16:13 6766在设计某个Activity时,界面使用了ListV ... -
如何在没有内置Google Map APIs的Android手机上安装程序
2012-04-01 11:20 2188在没有内置Googl ... -
如何直接下载Google为Android开发中提供的packages
2012-04-01 09:29 1391之前遇到过一个问题,想直接通过某个URL下载了早期 ... -
【转】Android 中SQLite事务处理的简单例子
2012-03-28 12:20 2287需要在Android 中进行SQLite事务处理, ... -
如何在Android手机中批量建立联系人数据
2012-03-22 14:54 2789因为测试需要,欲在Android手机中批量建立联系 ... -
Android程序运行时获取版本名称(versionName)
2012-03-16 15:14 6174问题起因:想在Android程序运行时,获取And ... -
Android中WebView显示HTML页面时右侧的空白
2012-03-08 11:12 5939在Android中使用WebView显示HTML页 ...
相关推荐
ImageView 图片显示样式的几种类型。android:scaleType是控制图片如何resized/moved来匹对ImageView的size。
Android中imageview.ScaleType使用方法详细介绍 ScaleType属性用以表示显示图片的方式,共有8种取值: ScaleType.CENTER:图片大小为原始大小,如果图片大小大于ImageView控件,则截取图片中间部分,若小于,则直接...
scaleType的属性值有:matrix fitXY fitStart fitCenter fitEnd center centerCrop centerInside 它们之间的区别如下: matrix 用矩阵来绘制(从左上角起始的矩阵区域) fitXY 把图片不按比例扩大/缩小到View的大小...
图解说明android中ImageView的scaletype属性.pdf
Android 中ImageView的ScaleType使用方法 ImageView的ScaleType属性,表示的是ImageView中资源图片的填充方式。scaleType的属性值有好几种,分别是: matrix(默认) center centerCrop centerInside fitCenter...
图解说明android中ImageView的scaletype属性.rar
图解说明android 中ImageView的scaletype属性.pdf
主要介绍了Android的ImageView类中的ScaleType属性设置,同时文中还讲了实现图片宽度100%ImageView宽度且高度按比例自动伸缩的方法,需要的朋友可以参考下
这篇随笔将会简单的记录下ImageView这个控件的一些使用方法,以及其最重要的一个属性: scaleType ImageView这个控件是用来显示图片用的,例如我们可以通过下面这段xml配置来声明显示一张图片: <ImageView n...
主要介绍了Android开发中ImageView的scaletype属性用法,分析了scaletype属性参数的常见功能并结合实例形式给出了具体的使用方法,需要的朋友可以参考下
本篇文章是对ImageView的属性android:scaleType的作用进行了详细的分析介绍,需要的朋友参考下
Android源码系列第一篇,这篇文章主要从源码的角度深入理解ImageView的ScaleType属性,感兴趣的小伙伴们可以参考一下
Android ImageView having extra scale types. Sample Release Note [Release Note] (https://github.com/yqritc/Android-ScalableImageView/releases) Gradle repositories { jcenter() } dependencies { ...
1, imageview设置scaletype为 android:scaleType=”matrix” 2, 设置imageview的setOnTouchListener,重写里面的代码 3, 新建一个matrix, matrix.postScale(scale,scale,缩放中心,缩放中心); image.setImageMatrix...