美文网首页
ImageView属性小结

ImageView属性小结

作者: Passon_Fang | 来源:发表于2016-02-23 14:26 被阅读410次

ImageView属性小结

待改进

属性

  1. 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)
  2. android:baseline:The offset of the baseline within this view. [dimension]

    Related Methods

    • setBaseline(int)
  3. android:baselineAlignBottom:If true, the image view will be baseline aligned with based on its bottom edge.[boolean]:底边对齐

    Related Methods

    • setBaselineAlignBottom(boolean)
  4. android:cropToPadding:If true, the image will be cropped to fit within its padding.[boolean] :图片会裁剪

    Related Methods

    • setCropToPadding(boolean)
  5. android:maxHeight:An optional argument to supply a maximum height for this view. [dimension]:设置控件的最大高度

    Related Methods

    • setMaxHeight(int)
  6. android:maxWidth

    Related Methods

    • setMaxWidth(int)
  7. 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)
  8. android:src:Sets a drawable as the content of this ImageView.[dimension]:设置图片源

    Related Methods

    • setImageResource(int)
  9. android:tint:Set a tinting color for the image.[color]:设置图片颜色,默认设置SRC_ATOP

    Related Methods

    • setImageTintList(ColorStateList)
  10. 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)

相关文章

网友评论

      本文标题:ImageView属性小结

      本文链接:https://www.haomeiwen.com/subject/avwbkttx.html