且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在开发适用于iOS 7的iPhone应用程序时,是否仍需要低分辨率图像来使用Interface Builder?

更新时间:2023-09-10 16:24:28

您正确地说,仅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.