zoukankan      html  css  js  c++  java
  • 2018/8/13

    <ImageView
    android:src="@drawable/Picture location"
    android:
    />

    android:scaleType="center".
    使图像在视图中居中,但不执行缩放。
    android:scaleType="centerCrop".
    缩放图像(保持图像的纵横比),使得图像的尺寸(宽度和高度)都等于或大于视图的相应维度(减去填充)。然后将图像集中在视图中。


    CENTER
    added in API level 1
    public static final ImageView.ScaleType CENTER
    Center the image in the view, but perform no scaling. From XML, use this syntax: android:scaleType="center".


    CENTER_CROP
    added in API level 1
    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".
    API参考

  • 相关阅读:
    C语言第十一周作业
    C语言第十周作业
    C语言第九周编程作业
    C语言第八周编程作业
    C语言第七周作业
    第六周作业
    第五周作业
    第四周作业
    第三周作业
    【BZOJ1488】[HNOI2009]图的同构计数
  • 原文地址:https://www.cnblogs.com/ZCWang/p/12507485.html
Copyright © 2011-2022 走看看