gpt4 book ai didi

java - 初始屏幕填满整个智能手机屏幕,但不裁剪

转载 作者:行者123 更新时间:2023-12-01 18:42:20 25 4
gpt4 key购买 nike

我想要一个闪屏,类似于全图,它不会在不同的智能手机屏幕上裁剪高度或宽度。

现在我使用 android:scaleType="fitXY" 实现了启动屏幕,但现在图像在顶部或底部被裁剪,或者如果设备屏幕尺寸更改为另一个纵横比,则会被裁剪左边和右边。

我必须做什么?我已经阅读了 Android 开发者文章 Supporting Multiple Screens,但我不知道如何实现这一点。

屏幕中间的简单图片很容易获得,但充满屏幕的图片很难获得。你能帮我吗?

最佳答案

出于此目的,您应该使用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).

关于java - 初始屏幕填满整个智能手机屏幕,但不裁剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19446532/

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