iPad 3 Retina 显示屏、@2x 图像和应用程序已在商店中提供
因此,未来的某些 iPad 可能会配备 Retina 显示屏。苹果很可能会坚持@2x范式。我期待这一点已经有一段时间了,所以我已经在我的应用程序中添加了适用于 iPad 的 @2x 图稿;有些已经在应用程序商店中。
我的问题是:当这款神秘的 iPad 发布时,我是否需要重新编译和/或重新提交应用程序才能使用所述艺术作品,以利用这些文件?或者这是操作系统本身内置的东西,它应该自动使用它们?
(由于之前也发生过同样的事情,那么在 iPhone-4 之前的 SDK 下发布的应用程序碰巧拥有正确的插图会发生什么情况?它们能正常工作吗?)
So some iPad in the future is probably going to have Retina Display. And Apple is most likely going to stick to the @2x paradigm. I've been expecting this for awhile and so I already have @2x artwork for iPad in my apps; some are already in the app store.
My question is this: Will I need to recompile and/or resubmit apps to use said artwork when this mythical iPad is released for it to take advantage of these files? Or is this something baked into the OS itself and it should just automagically use them?
(Since the same thing happened before, what happened w/ apps released under the pre-iPhone-4 SDKs that happened to have the right artwork? Did they just work?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我今天用视网膜 iPad 进行了实验,似乎会发生以下情况:
(我们有许多基于 XCode-3 的项目,其中许多是针对视网膜 iPhone 的混合项目。它们都没有在新 ipad 上使用 @2x 图形。当我在 Xcode 3 和 Xcode 4 中编译了一个测试项目,4 版本使用了视网膜资源,而 3 版本则没有。进一步的实验表明,差异被编译到可执行文件本身中,所以它不仅仅是像我这样的 info.plist 调整。曾是希望。)
[eta.:我的假设是,使用早期的 SDK 进行编译会在运行时将您链接到不同版本的 UIKit。当我更新代码时,奇怪的行为差异似乎证明了这一点。如果有人知道确切的咒语,请发表评论。]
[编辑再次添加:也有一些笔尖差异。在 xcode 4 中打开的旧项目不会使用 @2x 图形,直到我重新保存 MainWindow.nib;然后就一直这样,没有其他变化。我怀疑 UIWindow 对象的隐藏属性。]
I experimented with a retina iPad today, and here's what seems to happen:
(We have a number of XCode-3 based projects, many of which are hybrid for the retina iPhone. None of them used the @2x graphics on the new ipad. When I compiled a test project in both Xcode 3 and Xcode 4, the 4 build used the retina resource and the 3 build did not. Further experiments showed that the difference is compiled into the executable itself, so it's not just a info.plist tweak like I was hoping.)
[eta.: my hypothesis is that compiling with an earlier SDK links you against a different version of UIKit at runtime. Strange differences in behavior as I update our code seem to bear this out. If anyone knows the incantation to know for sure, please comment.]
[edited to add, again: there's some nib difference as well. An old project opened in xcode 4 would not use the @2x graphics until I re-saved my MainWindow.nib; then it did throughout, with no other changes. I suspect a hidden property of the UIWindow object.]
当使用在 Snow Leopard 上运行的 XCode 4.2 (iOS SDK 5.0) 进行构建时,我发现如下:
在代码中使用 [UIImage imagedNamed:] 以编程方式加载的图像将在视网膜 iPad 上正确加载 retina @2x 图像。
Interface Builder XIB 文件中的按钮和视图上指定的图像通常无法正确加载 @2x 视网膜图像。
我发现的解决方法是通过在视图控制器(或适当的)initWithNibName:(NSString *)bundle:(NSBundle *)中使用[UIImage imagedNamed:]调用来强制UIImage缓存XIB中引用的每个图像。编程方法可以很好地进行 @2x 加载,并且系统会对其进行缓存,XIB 加载机制最终会引用它,从而生成视网膜图像。例如:
我假设使用 XCode 4.3 (SDK 5.1) 构建可以与 XIB 一起正常工作,但我不准备升级到 Lion 只是为了使用该版本的 XCode。
What I've found when building with XCode 4.2 (iOS SDK 5.0) running on Snow Leopard is the following:
Images loaded programmatically using [UIImage imagedNamed:] in your code will properly load retina @2x images on the retina iPad.
Images specified on buttons and views in Interface Builder XIB files usually do NOT properly load the @2x retina images.
The workaround I discovered was to force UIImage to cache each of the images referenced in your XIB by using [UIImage imagedNamed:] calls in your view controller's (or appropriate) initWithNibName:(NSString *) bundle:(NSBundle *). The programmatic method does a good @2x load and the system caches it, which the XIB loading mechanism ends up referencing, yielding retina images. For example:
I assume that building with XCode 4.3 (SDK 5.1) works correctly with XIBs, but I was not prepared to upgrade to Lion just to use that version of XCode.
我认为这仅适用于该设备。据我了解,[UIImage imageNamed:] 会查找 @2x(如果设备支持)。所以它似乎内置于 iOS 中。这纯粹只是一个猜测。
I assume this will just work on the device. It is my understanding that [UIImage imageNamed:] looks for the @2x if the device supports it. So it seems built into iOS. This is purely just a guess.