android ImageView控件初步学习

资料:http://wikidroid.sinaapp.com/Android.widget.ImageView

Android.widget.ImageView

需要重点掌握的是:android:scaleType属性,此属性决定图片的显示缩放方式。

CENTER
Center the image in the view, but perform no scaling.按图片的原来size居中显示,当图片长/宽超过View的长/宽,则截取图片的居中部分显示.

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).
按比例扩大图片的size居中显示,使得图片长(宽)等于或大于View的长(宽)

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).将图片的内容完整居中显示,通过按比例缩小或原来的size使得图片长/宽等于或小于View的长/宽

FIT_CENTER
Scale the image using CENTER.把图片按比例扩大/缩小到View的宽度,居中显示

FIT_END
Scale the image usingEND.把图片按比例扩大/缩小到View的宽度,显示在View的下部分位置

FIT_START
Scale the image using START.把图片按比例扩大/缩小到View的宽度,显示在View的上部分位置

FIT_XY
Scale the image using FILL.把图片不按比例扩大/缩小到View的大小显示

MATRIX
Scaleusing the image matrix when drawing.用矩阵来绘制
posted @ 2013-05-28 13:31  oscar.liu  阅读(78)  评论(0)    收藏  举报