【问题标题】:Background image for LaunchScreen.storyboardLaunchScreen.storyboard 的背景图片
【发布时间】:2016-04-22 03:32:04
【问题描述】:

我正在使用故事板作为启动屏幕。

它有一个完整尺寸的 UIImageView 用于艺术作品,并在其上渲染了一个依赖于语言的 UILabel。

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

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

方法 1

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

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

我不知道我可以在情节提要中使用尺寸等级来区分 iPhone 4s 和 iPhone 5。或者我可以吗?

方法 2

在 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。

【问题讨论】:

    标签: ios iphone xcode uistoryboard launch-screen


    【解决方案1】:

    当我在 iPhone 4s 和 iPhone 5 上使用相同的图像时,一个看起来扭曲的圆圈。

    问题在于图像视图的内容模式。使用不会将图像拉伸到其纵横比之外的内容模式。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-16
      • 1970-01-01
      • 2011-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多