Customizing Image Sets for Devices
Add images to a set that are customized for display on the devices supported by your app.
-
In the set list, select an image set.
在图片集列表中,选择一个图片集。
-
Open the utilities area for the workspace window by clicking the Show Utilities button (
).点击(
)显示工作区窗口的工具区(utilities area). -
In the inspector bar, click the Attributes Inspector button (
).在inspector 栏,点击属性检查按钮 (
)。 -
From the Device pop-up menu, choose Device Specific.
在Device弹出菜单那,选择Device Specific.
![../Art/XC_AC_H_device-popup.shot/Resources/shot_2x.png]()
-
Use the checkboxes in the Attributes inspector to select the devices.
在属性检查器内选择需要设置的设备。
![../Art/XC_AC_H_device-checkboxes.shot/Resources/shot_2x.png]()
In the figure above, the image is customized for the iPhone and Apple Watch. The image still needs files for the retina 4-inch iPhone and both resolutions for the iPad.
上图,Image图片集是为iPhone和Apple Watch定义的。 图片集还需要retina 4-inch尺寸的iPhone文件,以及iPad的两种分辨率文件。
You need to add device specific images to a set only when your app needs to display different sizes of the image on different devices. For example, a background image for your main view showing a watermark of your logo could need all of the different sizes shown in the figure above. But an icon for a button that does not vary between devices can use only the universal setting shown in the first figure because no special sizes are required.
只有当你的应用程序需要在不同的设备上显示不同尺寸的图片时才需要把设备指定的图片放入一个集合。 比如,一张用于主视图的背景图片,图片上需要打印不同尺寸的Logo水印时可以使用上图所示的指定特殊设备的图片集。如果只是一个用于按钮的图标,它在不同设备间不会变化的图标,则只需要使用图一种的universal设置,因为不需要特殊的尺寸。
Customizing your images for devices is one way that your app can support multiple screen sizes and orientations. For apps designed for iOS 8 and later, size classes provide a more flexible alternative.
为不同设备自定义不同图片是让你的应用程序支持多个屏幕尺寸和方向的一种方法。对于iOS8或以上版本的应用程序,尺寸类可以提供一种更加灵活的替代选择。


浙公网安备 33010602011771号