Asset Catalog Help (七)---Customizing Image Sets for Size Classes

本文介绍如何在Xcode中为不同尺寸类自定义图片集,包括选择图片集、设置尺寸类并添加占位符的过程。适用于iOS8及以上版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Customizing Image Sets for Size Classes

Add images to a set that are customized for display in different size classes supported by your app.

应用程序也支持把图片存入一个自定义集合,用来在不同的尺寸类中显示。
  1. In the set list, select an image set.

    在集合列表(set list)中,选择一个图片集。

  2. Open the utilities area for the workspace window by clicking the Show Utilities button (../Art/XC_O_utilities_button_2x.png).

    点击(../Art/XC_O_utilities_button_2x.png)显示工作区窗口的工具区(utilities area).

  3. In the inspector bar, click the Attributes Inspector button (../Art/XC_O_attributes_inspector_button_2x.png).

    在inspector 栏,点击属性检查按钮 (../Art/XC_O_attributes_inspector_button_2x.png)。

  4. Choose Universal from the Device pop-up menu.

    在设备弹出菜单那选择Universal.

    ../Art/XC_AC_H_device-popup.shot/Resources/shot_2x.png
  5. Choose a specific size class from the Width or Height size pop-up menu or from both.

    在width 或者Height弹出菜单中选择一个指定的尺寸类(size class)。

    ../Art/XC_AC_H_size_class_popup.shot/Resources/shot_2x.png

    After you choose a size class, Xcode adds placeholders for image files in the set viewer area.

    选择完成后,Xcode 在图片集查看区(set viewer)为图片文件添加占位符。

    ../Art/XC_AC_H_size_classes.shot/Resources/shot_2x.png

The size class settings for a placeholder image are shown in coded format following the size of the image. The format is [horizontal size class, vertical size class]. Each size class can be one of three values:

size class(尺寸类) 为一个占位图片的格式是把图片的尺寸以编码格式显示。 格式为[横向尺寸类 纵向尺寸类]. 每个尺寸类 可以是以下三个值中的一个:

../Art/XC_AC_H_size_class_any_2x.png

Any size class 任何尺寸类

../Art/XC_AC_H_size_class_regular_2x.png

Regular size class 常规尺寸类

../Art/XC_AC_H_size_class_compact_2x.png

Compact size class  紧凑尺寸类

For example, ../Art/XC_AC_H_size_class_example_2x.png is a 2x resolution image used with a compact horizontal size class and any vertical size class.

比如, 2x[- *] 是一个2倍分辨率图片,它的尺寸类是紧凑横向尺寸类和纵向任何尺寸类。

Size classes require iOS 8 or later. If your app will support earlier versions of iOS, you can customize image sets for specific devices. See the link in Related Articles below. Size classes are note supported on OS X.

 尺寸类要求iOS8或以上版本: 如果你的应用程序支持iOS早期版本,你可以为指定的设备自定义图片集。请看下面的相关文章。 OS X也支持尺寸类。

转载于:https://www.cnblogs.com/patientAndPersist/p/4428689.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值