CLKComplicationFamily 官方文档
CLKComplication
包含一个CLKComplicationFamily
枚举属性,来标识其所属的类型,在ClockKit框架
中用CLKComplicationFamily
枚举值来标识模板组。
如果App支持某个CLKComplicationFamily
,需在CLKComplicationDataSource
代理方法中返回对应的CLKComplicationTemplate
实例。
CLKComplicationTemplate 官方文档
CLKComplicationTemplate
是所有模板的抽象类,在使用过程中需要创建某一子类的实例,并指定数据。CLKComplicationTemplate
的子类大致有57个,并被CLKComplicationFamily
归纳为12大类。
下面介绍CLKComplicationFamily
各个枚举值对应的Complication
及CLKComplicationTemplate
子类。
注意:
下面提到的模板所需的图片,所有尺寸均以像素为单位。必须将所有图像指定为@2x,因此基于点的尺寸是所列尺寸的一半。
Modular Small(模块化-小)
ClockKit在模块化表盘上显示的一个小正方形区域。
case modularSmall = 0

.modularSmall
支持的模板
模块化的小型模板在模块化表盘上显示两排内容的堆叠行,一个图标和一个内容,一个圆形图或一个较大的项目。

ModularSmallRingImage
class CLKComplicationTemplateModularSmallRingImage
用于显示由可配置进度环环绕的图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 36像素 | 36像素 |
40毫米 | 38像素 | 38像素 |
42毫米 | 38像素 | 38像素 |
44毫米 | 42像素 | 42像素 |
ModularSmallSimpleImage
class CLKComplicationTemplateModularSmallSimpleImage
用于显示图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 52像素 | 52像素 |
40毫米 | 58像素 | 58像素 |
42毫米 | 58像素 | 58像素 |
44毫米 | 64像素 | 64像素 |
ModularSmallStackImage
class CLKComplicationTemplateModularSmallStackImage
用于显示单个图像并在其下方带有一小段文本的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最多52像素 | 28像素 |
40毫米 | 最多58像素 | 30像素 |
42毫米 | 最多58像素 | 30像素 |
44毫米 | 最多64像素 | 34像素 |
ModularSmallColumnsText
class CLKComplicationTemplateModularSmallColumnsText
用于显示两行两列文本的模板。

ModularSmallRingText
class CLKComplicationTemplateModularSmallRingText
用于显示由可配置进度环包围的文本的模板。

ModularSmallSimpleText
class CLKComplicationTemplateModularSmallSimpleText
用于显示少量文本的模板。

ModularSmallStackText
class CLKComplicationTemplateModularSmallStackText
用于显示两个字符串的模板,其中一个堆叠在另一个之上。

Modular Large(模块化-大)
ClockKit在模块化表盘上显示的一个较大的矩形区域。
case modularLarge = 1

.modularLarge
支持的模板
模块化的大型模板提供了一块大画布,可在模块化表盘上最多显示三行内容。

ModularLargeStandardBody
class CLKComplicationTemplateModularLargeStandardBody
用于显示标题行和两行小行文本的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最少22像素 最多64个像素 |
22像素 |
40毫米 | 最少24像素 最多74个像素 |
24像素 |
42毫米 | 最少24像素 最多74个像素 |
24像素 |
44毫米 | 最少28像素 最多84个像素 |
28像素 |
ModularLargeTallBody
class CLKComplicationTemplateModularLargeTallBody
用于显示标题行和大行文本行的模板。

ModularLargeColumns
class CLKComplicationTemplateModularLargeColumns
用于显示多列数据的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最少22像素 最多64个像素 |
22像素 |
40毫米 | 最少24像素 最多74个像素 |
24像素 |
42毫米 | 最少24像素 最多74个像素 |
24像素 |
44毫米 | 最少28像素 最多84个像素 |
28像素 |
ModularLargeTable
class CLKComplicationTemplateModularLargeTable
用于显示标题行和列的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最少22像素 最多64个像素 |
22像素 |
40毫米 | 最少24像素 最多74个像素 |
24像素 |
42毫米 | 最少24像素 最多74个像素 |
24像素 |
44毫米 | 最少28像素 最多84个像素 |
28像素 |
Utilitarian Small(实用-小)
ClockKit在实用程序,米奇,计时码表和简单表盘上显示的一个小正方形或矩形区域。
case utilitarianSmall = 2

.utilitarianSmall
支持的模板
小型实用模板在表盘一角占据了一个短矩形区域。内容可以包括字形或图标,也可以包括圆形图。

UtilitarianSmallFlat
class CLKComplicationTemplateUtilitarianSmallFlat
用于在一行中显示图像和文本的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最少18像素 最多42个像素 |
18像素 |
40毫米 | 最少20像素 最多44个像素 |
20像素 |
42毫米 | 最少20像素 最多44个像素 |
20像素 |
44毫米 | 最少22像素 最多49个像素 |
22像素 |
UtilitarianSmallRingImage
class CLKComplicationTemplateUtilitarianSmallRingImage
用于显示由可配置进度环环绕的图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 28像素 | 28像素 |
40毫米 | 28像素 | 28像素 |
42毫米 | 28像素 | 28像素 |
44毫米 | 32像素 | 32像素 |
UtilitarianSmallRingText
class CLKComplicationTemplateUtilitarianSmallRingText
用于显示由可配置进度环包围的文本的模板。

UtilitarianSmallSquare
class CLKComplicationTemplateUtilitarianSmallSquare
用于显示单个正方形图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 40像素 | 40素 |
40毫米 | 44像素 | 44像素 |
42毫米 | 44像素 | 44像素 |
44毫米 | 50像素 | 50像素 |
Utilitarian Small Flat(实用-小-扁平)
ClockKit在“照片”,“运动”和“缩时摄影”表盘上显示的一个小矩形区域。
@available(watchOS 3.0, *)
case utilitarianSmallFlat = 6

.utilitarianSmallFlat
支持的模板
小型实用扁平模板在表盘一角占据了一个短矩形区域。内容可以包括字形或图标。
与.utilitarianSmall
不同的是,此类型的枚举标识的模板不可以包括圆形图,只能显示CLKComplicationTemplateUtilitarianSmallFlat
。
Utilitarian Large(实用-大)
一个大的矩形区域,横跨实用程序和米奇表盘的屏幕宽度。
case utilitarianLarge = 3

.utilitarianLarge
支持的模板
大型实用模板在表盘底部占据一个长矩形区域。该区域可以显示较长的文本字符串和较小的图像。

UtilitarianLargeFlat
class CLKComplicationTemplateUtilitarianLargeFlat
用于在单个长行中显示图像和字符串的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最少18像素 最多42像素 |
18像素 |
40毫米 | 最少20像素 最多44像素 |
20像素 |
42毫米 | 最少20像素 最多44像素 |
20像素 |
44毫米 | 最少22像素 最多49像素 |
22像素 |
Circular Small(圆形-小)
ClockKit在Color表盘上显示的一个小圆形区域。
case circularSmall = 4

.circularSmall
支持的模板
圆形小模板在Color表盘的角部显示一个小图像或一些字符的文本。

CircularSmallRingImage
class CLKComplicationTemplateCircularSmallRingImage
用于显示由可配置进度环包围的单个图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 40像素 | 40像素 |
40毫米 | 44像素 | 44像素 |
42毫米 | 44像素 | 44像素 |
44毫米 | 48像素 | 48像素 |
CircularSmallSimpleImage
class CLKComplicationTemplateCircularSmallSimpleImage
用于显示单个图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 32像素 | 32像素 |
40毫米 | 36像素 | 36像素 |
42毫米 | 36像素 | 36像素 |
44毫米 | 40像素 | 40像素 |
CircularSmallStackImage
class CLKComplicationTemplateCircularSmallStackImage
用于显示图像并在其下方带有一行文本的模板。 文字范本

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最多32像素 | 14像素 |
40毫米 | 最多34像素 | 16像素 |
42毫米 | 最多34像素 | 16像素 |
44毫米 | 最多38像素 | 18像素 |
CircularSmallRingText
class CLKComplicationTemplateCircularSmallRingText
用于显示由可配置进度环环绕的短文本字符串的模板。

CircularSmallSimpleText
class CLKComplicationTemplateCircularSmallSimpleText
用于显示短文本字符串的模板。

CircularSmallStackText
class CLKComplicationTemplateCircularSmallStackText
用于显示彼此堆叠的两个文本字符串的模板。

Extra Large(特大号)
ClockKit在X-Large表盘上显示的一个大正方形区域。
case extraLarge = 7

.extraLarge
支持的模板
超大模板在X-Large表盘上显示文本和图像。

ExtraLargeRingImage
class CLKComplicationTemplateExtraLargeRingImage
用于显示由可配置进度环环绕的图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 126像素 | 126像素 |
40毫米 | 133像素 | 133像素 |
42毫米 | 133像素 | 133像素 |
44毫米 | 146像素 | 146像素 |
ExtraLargeSimpleImage
class CLKComplicationTemplateExtraLargeSimpleImage
用于显示图像的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 182像素 | 182像素 |
40毫米 | 203像素 | 203像素 |
42毫米 | 203像素 | 203像素 |
44毫米 | 224像素 | 224像素 |
ExtraLargeStackImage
class CLKComplicationTemplateExtraLargeStackImage
用于显示单个图像并在其下方带有一小段文本的模板。

此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
38毫米 | 最多156像素 | 84像素 |
40毫米 | 最多174像素 | 90像素 |
42毫米 | 最多174像素 | 90像素 |
44毫米 | 最多192像素 | 102像素 |
ExtraLargeColumnsText
class CLKComplicationTemplateExtraLargeColumnsText
用于显示两行两列文本的模板。

ExtraLargeRingText
class CLKComplicationTemplateExtraLargeRingText
用于显示由可配置进度环包围的文本的模板。

ExtraLargeSimpleText
class CLKComplicationTemplateExtraLargeSimpleText
用于显示少量文本的模板

ExtraLargeStackText
class CLKComplicationTemplateExtraLargeStackText
用于显示两个字符串的模板,其中一个堆叠在另一个之上。

Graphic Corner(形象-角落)
弯曲的区域充满了Infograph表盘的各个角落。
@available(watchOS 5.0, *)
case graphicCorner = 8

.graphicCorner
支持的模板
图形角模板在表盘的角上显示量规,图像和文本。

模板的着色版本如下所示:

GraphicCornerCircularImage
class CLKComplicationTemplateGraphicCornerCircularImage
用于在钟面的一角显示图像的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 64像素 | 64像素 |
44毫米 | 72像素 | 72像素 |
GraphicCornerStackText
class CLKComplicationTemplateGraphicCornerStackText
用于在钟面的一角显示堆叠文本的模板。

系统始终将外部文本显示为白色。内部文本可以是彩色的。
GraphicCornerTextImage
class CLKComplicationTemplateGraphicCornerTextImage
用于在钟面的一角显示图像和文本的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 40像素 | 40像素 |
44毫米 | 44像素 | 44像素 |
GraphicCornerGaugeImage
class CLKComplicationTemplateGraphicCornerGaugeImage
用于在钟面的一角显示图像和量规的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 40像素 | 40像素 |
44毫米 | 44像素 | 44像素 |
GraphicCornerGaugeText
class CLKComplicationTemplateGraphicCornerGaugeText
用于在表盘的角落显示文本和量规的模板。

系统始终将外部文本显示为白色。量规的文本可以是彩色的。
Graphic Bezel(形象-边框)
ClockKit沿着Infograph表盘的表圈显示带有可选弯曲文本的圆形区域。
case graphicBezel = 9

.graphicBezel
支持的模板
GraphicBezelCircularText
class CLKComplicationTemplateGraphicBezelCircularText
图形边框模板显示圆形模板,文字环绕表盘。
文本是可选的;此模板可以显示带有文本的圆形模板,也可以显示圆形模板本身。
Graphic Circular(形象-圆形)
ClockKit在Infograph和Infograph Modular表盘上显示的圆形区域。
case graphicCircular = 10

.graphicCircular
支持的模板
图形圆形模板显示应用程序数据的精简版本。

模板的着色版本如下所示:

GraphicCircularImage
class CLKComplicationTemplateGraphicCircularImage
用于显示全彩圆形图像的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 84像素 | 84像素 |
44毫米 | 94像素 | 94像素 |
GraphicCircularStackImage
class CLKComplicationTemplateGraphicCircularStackImage
用于显示全彩圆形图像和文本的模板。

该模板支持全彩色图像。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 56像素 | 28像素 |
44毫米 | 62像素 | 32像素 |
GraphicCircularStackText
class CLKComplicationTemplateGraphicCircularStackText
用于显示两行文本的模板。

CircularOpenGaugeImage
class CLKComplicationTemplateGraphicCircularOpenGaugeImage
用于显示全彩圆形图像,开口规和文本的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 22像素 | 22像素 |
44毫米 | 24像素 | 24像素 |
GraphicCircularOpenGaugeSimpleText
class CLKComplicationTemplateGraphicCircularOpenGaugeSimpleText
用于在开放式仪表中显示文本的模板,该仪表具有单个文本。

GraphicCircularOpenGaugeRangeText
class CLKComplicationTemplateGraphicCircularOpenGaugeRangeText
用于在开放式仪表中显示文本的模板,该仪表带有仪表盘的前导文本和尾随文本。

GraphicCircularClosedGaugeImage
class CLKComplicationTemplateGraphicCircularClosedGaugeImage
用于显示全彩圆形图像和闭合圆形量规的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 54像素 | 54像素 |
44毫米 | 62像素 | 62像素 |
GraphicCircularClosedGaugeText
class CLKComplicationTemplateGraphicCircularClosedGaugeText
用于在封闭的圆形量规内显示文本的模板。

Graphic Rectangular(形象-矩形)
ClockKit在Infograph Modular表盘中心的中央显示一个大矩形区域。
@available(watchOS 5.0, *)
case graphicRectangular = 11

.graphicRectangular
支持的模板
图形矩形模板为显示图像或多行文本提供了较大的空间。

模板的着色版本如下所示:

GraphicRectangularStandardBody
class CLKComplicationTemplateGraphicRectangularStandardBody
用于显示包含文本的大矩形的模板。

该模板支持全彩色图像。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 24像素 | 24像素 |
44毫米 | 27像素 | 27像素 |
GraphicRectangularTextGauge
class CLKComplicationTemplateGraphicRectangularTextGauge
用于显示包含文本和量规的大矩形的模板。

该模板支持全彩色图像。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 24像素 | 24像素 |
44毫米 | 27像素 | 27像素 |
GraphicRectangularLargeImage
class CLKComplicationTemplateGraphicRectangularLargeImage
用于显示包含标题文本和图像的大矩形的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版为具有8像素角半径的圆角矩形。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 300像素 | 94像素 |
44毫米 | 342像素 | 108像素 |
GraphicRectangularFullImage
class CLKComplicationTemplateGraphicRectangularFullImage
用于显示填充复杂图像的全色图像的模板。

该模板支持全彩色图像。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 324像素 | 138像素 |
44毫米 | 368像素 | 156像素 |
Graphic Extra Large(形象-巨大)(类似较大版本 Graphic Circular)
ClockKit在X-Large表盘上显示的一个大正方形区域。
@available(watchOS 7.0, *)
case graphicExtraLarge = 12

仅适用于 40 mm 和 44 mm 的 Apple Watch,如果可用,且同时支持
.extraLarge
和.graphicExtraLarge
,系统会优先选择.graphicExtraLarge
。
.graphicExtraLarge
支持的模板
这些模板是.graphicCircular
对应模板的较大版本,效果一样,但模板较大:

GraphicExtraLargeCircularImage
class CLKComplicationTemplateGraphicExtraLargeCircularImage
用于显示超大全彩圆形图像的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 240像素 | 240像素 |
44毫米 | 264像素 | 264像素 |
GraphicExtraLargeCircularStackImage
class CLKComplicationTemplateGraphicExtraLargeCircularStackImage
用于显示超大的全彩色圆形图像和文本的模板。

该模板支持全彩色图像。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 160像素 | 80像素 |
44毫米 | 174像素 | 80像素 |
GraphicExtraLargeCircularStackText
class CLKComplicationTemplateGraphicExtraLargeCircularStackText
用于以超大圆形复杂度显示两行文本的模板。

GraphicExtraLargeCircularOpenGaugeImage
class CLKComplicationTemplateGraphicExtraLargeCircularOpenGaugeImage
用于显示超大的全彩色圆形图像,开口规和文本的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 62像素 | 62像素 |
44毫米 | 66像素 | 66像素 |
GraphicExtraLargeCircularOpenGaugeSimpleText
class CLKComplicationTemplateGraphicExtraLargeCircularOpenGaugeSimpleText
用于在开放式量规中显示文本的模板,量规底部带有其他文本。

GraphicExtraLargeCircularOpenGaugeRangeText
class CLKComplicationTemplateGraphicExtraLargeCircularOpenGaugeRangeText
用于在开放式仪表内显示文本的模板,以及其他前导和尾随文本。

GraphicExtraLargeCircularClosedGaugeImage
class CLKComplicationTemplateGraphicExtraLargeCircularClosedGaugeImage
用于在封闭的圆形量规内显示超大全彩圆形图像的模板。

该模板支持全彩色图像。图像提供程序会自动将图像蒙版成一个圆圈。
此模板中使用的图像的尺寸:
苹果手表尺寸 | 宽度 | 高度 |
---|---|---|
40毫米 | 154像素 | 154像素 |
44毫米 | 174像素 | 174像素 |
GraphicExtraLargeCircularClosedGaugeText
class CLKComplicationTemplateGraphicExtraLargeCircularClosedGaugeText
用于在超大型封闭式圆形量规内显示文本的模板。

网友评论