Xcode 自定义符号图像集资产
Xcode custom symbol image set asset
来自 Apples documentation 我读到:
An alternative to creating bitmap images is to use template images or symbol images instead. Template images specify the shape you want to draw, but not the associated color information. Symbol images are similar to template images but are vector based, so they scale to different sizes. Both types of images simplify the process for supporting Dark Mode. They also reduce the number of image assets you must ship with your app.
我不能使用基于矢量的 symbol image set
作为位图的替代品但可扩展,我的理解是否正确?
更新
我的情况:
我的 iOS 项目中有一个图像集。在那里我可以为三个缩放选项 iOS 设备支持添加三个位图。这些图像必须是 *.png
类型
现在我想用一个矢量图形文件 *.svg 替换这三个位图。这似乎不可能。如果我想使用矢量图形图像,我必须添加另一种名为 "symbol image set" 的资产类型(Xcode -> 编辑器 -> 添加资产 -> 新符号图像集)。
到目前为止一切顺利但是现在我的问题。这些 "symbol image set" 资产仅考虑形状而不考虑颜色信息。这就是为什么我想要考虑颜色信息但文件是矢量图形文件 (*.svg) 的 "old" 方式。
您实际上不需要符号集来实现您想要实现的目标。
你只需要一张pdf
格式的矢量图,标记为Single Scale
然后,您可以将资产标记为 template
(意味着您可以用任何颜色对其着色)或 original
(如果您想保留其原始颜色)。
最后,请注意,尽管您提供矢量图像,Xcode 默认情况下会在幕后为所有比例生成 png
版本。如果您需要保留矢量数据(这在某些需要放大的情况下会有所帮助),您也可以启用 Preserve Vector Data
。
来自 Apples documentation 我读到:
An alternative to creating bitmap images is to use template images or symbol images instead. Template images specify the shape you want to draw, but not the associated color information. Symbol images are similar to template images but are vector based, so they scale to different sizes. Both types of images simplify the process for supporting Dark Mode. They also reduce the number of image assets you must ship with your app.
我不能使用基于矢量的 symbol image set
作为位图的替代品但可扩展,我的理解是否正确?
更新
我的情况: 我的 iOS 项目中有一个图像集。在那里我可以为三个缩放选项 iOS 设备支持添加三个位图。这些图像必须是 *.png
类型现在我想用一个矢量图形文件 *.svg 替换这三个位图。这似乎不可能。如果我想使用矢量图形图像,我必须添加另一种名为 "symbol image set" 的资产类型(Xcode -> 编辑器 -> 添加资产 -> 新符号图像集)。
到目前为止一切顺利但是现在我的问题。这些 "symbol image set" 资产仅考虑形状而不考虑颜色信息。这就是为什么我想要考虑颜色信息但文件是矢量图形文件 (*.svg) 的 "old" 方式。
您实际上不需要符号集来实现您想要实现的目标。
你只需要一张pdf
格式的矢量图,标记为Single Scale
然后,您可以将资产标记为 template
(意味着您可以用任何颜色对其着色)或 original
(如果您想保留其原始颜色)。
最后,请注意,尽管您提供矢量图像,Xcode 默认情况下会在幕后为所有比例生成 png
版本。如果您需要保留矢量数据(这在某些需要放大的情况下会有所帮助),您也可以启用 Preserve Vector Data
。