gpt4 book ai didi

android - 如何正确显示图像?

转载 作者:行者123 更新时间:2023-11-29 18:04:42 25 4
gpt4 key购买 nike

我用它来显示图像背景:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/picture_happy"
android:padding="20dp"
android:scaleType="centerCrop"
tools:context=".MainActivity" >

图像失真。有没有办法显示像素 1:1?只是从显示器上截下什么流过?

我不担心被剪掉的东西。

谢谢!埃里克

更新以添加图片

enter image description here

最佳答案

将 scaleType 更改为 centerCrop:

android:scaleType="centerCrop"

有关比例类型的更多信息,请参阅此图片:

enter image description here

顶行(从左到右):

中心,中心裁剪,中心内。底行 (l-r):fitCenter、fitStart、fitEnd、fitXY。

关于android - 如何正确显示图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14015412/

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