在开发适用于iOS 7的iPhone应用程序时,是否仍需要低分辨率图像来使用Interface Builder? [英] Do I still need low-resolution images for using Interface Builder when developing iPhone app for iOS 7?

查看:116
本文介绍了在开发适用于iOS 7的iPhone应用程序时,是否仍需要低分辨率图像来使用Interface Builder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始为iOS 7开发一个iPhone应用程序.

I started to develop an iPhone app for iOS 7.

由于iOS 7不支持iPhone/iPod touch配备非视网膜显示屏的设备,并且它在iPhone仿真模式下在非视网膜iPad(iPad 2和iPad mini)上使用高分辨率图像,因此我认为在开发部署目标为iOS 7的仅限iPhone的应用时,我们不需要提供低分辨率的图像.

Since iOS 7 does not support devices with non-retina display for the iPhone/iPod touch, and it uses high-resolution images on non-retina iPads (iPad 2 and iPad mini) in the iPhone emulation mode, now I think we don't need to provide low-resolution images when developing an iPhone-only app which deployment target is iOS 7.

我认为这很棒,但是很快我在使用情节提要时遇到了一个问题.显然,Interface Builder无法显示文件名以@ 2x结尾的高分辨率图像.

I thought it's great, but soon I faced a problem when I used a Storyboard; apparently Interface Builder can not display high-resolution images which file names end with @2x.

我真的很遗憾,我们只能为Interface Builder提供低分辨率的图像...

I feel it's really pity that we have to provide the low-resolution images ONLY for the Interface Builder...

有什么好的解决方法吗?还是要使用Interface Builder还是必须提供低分辨率的图像?

Is there any good workaround for this? Or do we still have to provide low-resolution images if we want to use the Interface Builder?

推荐答案

您正确地说,仅iOS 7 iPhone应用程序不会在任何单分辨率设备上运行,因此您只需要提供双分辨率图像即可. .进行过去的操作:将图像称为myImage,但将实际的图像文件命名为myImage@2x.png.更好的是,使用资产目录!将双分辨率图像放置在2x插槽中,并以该图像集的名称进行引用.无论哪种方式,这都将在情节提要编辑器和正在运行的应用程序中完美运行.在情节提要板编辑器中,媒体库"和带有图像的按钮之类的东西将显示图像的名称为myImage.

You are correct that an iOS 7 iPhone-only app is not going to run on any single-resolution devices, so you only need to provide double-resolution images. Do what you have always done in the past: refer to your image as myImage but name the actual image file myImage@2x.png. Even better, use the asset catalog! Place the double-resolution image in the 2x slot and refer to it by the name of that image set. Either way, this will work perfectly both in the storyboard editor and in the running app; in the storyboard editor, the Media Library and things like buttons that have images will display your image's name as myImage.

这篇关于在开发适用于iOS 7的iPhone应用程序时,是否仍需要低分辨率图像来使用Interface Builder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆