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参考

  • 相关阅读:
    「搬运」影魔
    「不会」斯特林数
    「不会」二项式反演
    「不会」插头dp
    「不会」主定理
    「不会」网络流
    接口和抽象类的区别
    TestNG常用注解
    九九乘法表-Java
    冒泡排序和选择排序--Java
  • 原文地址:https://www.cnblogs.com/ZCWang/p/12507485.html
Copyright © 2011-2022 走看看