gpt4 book ai didi

ios - LaunchScreen.storyboard 的背景图像

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

我正在使用 Storyboard作为启动屏幕。

它有一个全尺寸的 UIImageView 用于艺术作品和一个在其上渲染的依赖于语言的 UILabel。

我确实有适用于所有可能的 iPhone 屏幕尺寸的 .png 文件(iPad 不是必需的)。

当我为 iPhone 4s 和 iPhone 5 使用相同的图像时,艺术品包含一个看起来扭曲的圆圈。

方法一

在 LaunchScreen.storyboard 中,我为所有 iPhone 添加一个 UIImageView 并使用在 Assets.xcassets 中定义的 imageSet。

当我这样做时,图像集的 image@2x 用于 iPhone 4s 和 iPhone 5 5s。两者之一看起来很糟糕,因为 iPhone 4s 和 5 的高度不同。

我不知道我可以在 Storyboard 中使用尺寸类来区分 iPhone 4s 和 iPhone 5。或者我可以吗?

方法二

在 Assets.xcassets 中创建一个启动图像集,它可以容纳所有必要的图像尺寸。

我无法选择在 UIImageView 中设置的这个启动图像作为图像。

问题

在 LaunchScreen.storyboard 中的全尺寸 UIImageView 中:如何显示不同的 png

  • iPhone 4 + 4s 640 x 960 像素
  • iPhone 5 + 5s 640 x 1136 像素
  • iPhone 6 + 6s 750 x 1334 像素
  • iPhone 6 plus + 6s plus 1242 x 2208 像素(纵向和横向)

主要问题似乎是区分 4 + 4s 和 5 + 5s。

最佳答案

a circle that looks distorted when I use the same image for iPhone 4s and iPhone 5.

问题在于 ImageView 的内容模式。使用不会拉伸(stretch)图像超出其纵横比的内容模式。

关于ios - LaunchScreen.storyboard 的背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34829709/

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