gpt4 book ai didi

android - 'center' 中的 'centerCrop' 和 "ImageView"有什么区别?

转载 作者:行者123 更新时间:2023-12-05 00:11:13 25 4
gpt4 key购买 nike

1-android:scaleTaype="center"

2-android:scaleTaype="centerCrop"

1和2有什么区别?

最佳答案

CENTER :- 使图像在 View 中居中,但不执行缩放。

enter image description here

CENTER_CROP :- 均匀缩放图像(保持图像的纵横比),使图像的两个尺寸(宽度和高度)等于或大于 View 的相应尺寸(减去填充)。然后图像在 View 中居中。 enter image description here

引用this official documentation查看所有 ScaleTypesthis site 的概览详细解释

关于android - 'center' 中的 'centerCrop' 和 "ImageView"有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56855894/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com