【问题标题】:Is there a way to simply use images in apps supporting iPhone 5? [duplicate]有没有办法在支持 iPhone 5 的应用程序中简单地使用图像? [复制]
【发布时间】:2012-09-14 11:14:45
【问题描述】:

可能重复:
iPhone 5 - what naming convention the new images have to follow?

我刚刚下载了新的 xcode,并为新的屏幕尺寸添加了新的初始屏幕。所以现在我有 3 个文件:

默认.png, 默认@2x.png, 默认-568h@2x.png

到目前为止,如果我想用它制作 UIImage,我可以简单地这样做:

UIImage *img = [UIImage imageNamed: @"Default"];

并且 Default.png 或 Default@2x.png 会根据应用程序执行的 iphone 类型自动选择。但是现在有了新的屏幕尺寸,当然它仍然适用于普通屏幕/视网膜屏幕,但不适用于 4" 屏幕。我该如何检测应用程序何时在 iphone 5 上运行,然后使用 *-568h 图像?

【问题讨论】:

  • 我猜你只需要做一个 [UIImage imageNamed:@"Default.png"]。就像识别和使用 2x 图像(如果存在)一样,iPhone 5 图像也将被使用。
  • Xcode 没有检测到除Default.png 之外的任何图像的-568h-568h@2x 句柄。有谁知道为什么??

标签: ios retina-display iphone-5


【解决方案1】:

您只需要添加Default-568h@2x.png 图像,大小为640 x 1136 px。 在 Xcode 4.5 中,您还可以在目标摘要中找到 4" 启动图像的新字段。

【讨论】:

    猜你喜欢
    • 2010-10-01
    • 1970-01-01
    • 2022-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-03
    • 1970-01-01
    • 2020-10-17
    相关资源
    最近更新 更多