ImageView属性小结
待改进
属性
-
android:adjustViewBounds
:Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable. [boolean]:设置控件的边界是否要随里面的图片调整。方法
- setAdjustViewBounds(boolean)
-
android:baseline
:The offset of the baseline within this view. [dimension]Related Methods
- setBaseline(int)
-
android:baselineAlignBottom
:If true, the image view will be baseline aligned with based on its bottom edge.[boolean]:底边对齐Related Methods
- setBaselineAlignBottom(boolean)
-
android:cropToPadding
:If true, the image will be cropped to fit within its padding.[boolean] :图片会裁剪Related Methods
- setCropToPadding(boolean)
-
android:maxHeight
:An optional argument to supply a maximum height for this view. [dimension]:设置控件的最大高度Related Methods
- setMaxHeight(int)
-
android:maxWidth
Related Methods
- setMaxWidth(int)
-
android:scaleType
:Controls how the image should be resized or moved to match the size of this ImageView.[enum]:设置控件内部的图片的显示模式Values
- matrix:0,
- fitXY:1,
- fitStart:2,
- fitCenter:3,
- fitEnd:4,
- center:5,
- centerCrop:6,
- centerInside:7,
Related Methods
- setScaleType(ImageView.ScaleType)
-
android:src
:Sets a drawable as the content of this ImageView.[dimension]:设置图片源Related Methods
- setImageResource(int)
-
android:tint
:Set a tinting color for the image.[color]:设置图片颜色,默认设置SRC_ATOP
Related Methods
- setImageTintList(ColorStateList)
-
android:tintMode
:Blending mode used to apply the image tint.[enum]:图片的颜色模式Values
- src_over:3,
- src_in:5,
- src_atop:9,
- multiply:14,
- screen:15,
- add:16
Related Methods
- setImageTintMode(PorterDuff.Mode)
网友评论