diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-securitycomponent.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-securitycomponent.md index 2a9736d5b2ce00cd6134b21efa89c67ff08ae7c5..4165e928cb4bc51575bf352e8debc4d02fac7950 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-securitycomponent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-securitycomponent.md @@ -1,4 +1,4 @@ -# 安全组件通用属性 +# 安全组件通用 安全组件的基础属性,用于设置安全组件通用的属性。 @@ -8,40 +8,40 @@ ## 属性 -| 名称 | 参数类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ---------------------------------------- | -| iconSize | [Length](ts-types.md#length) | 否 | 设置安全组件上图标的尺寸。
默认值:16vp | -| layoutDirection | [SecurityComponentLayoutDirection](#securitycomponentlayoutdirection枚举说明) | 否 | 设置安全组件上图标和文字分布的方向。
默认值:SecurityComponentLayoutDirection.HORIZONTAL| -| layoutOrder | [SecurityComponentLayoutOrder](#securitycomponentlayoutorder枚举说明) | 否 | 设置安全组件上图标和文字分布的顺序。
默认值:SecurityComponentLayoutOrder.ICON_FIRST| -| position | [Position](ts-types.md#position8) | 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。
默认值:
{
x: 0,
y: 0
} | -| markAnchor | [Position](ts-types.md#position8) | 否 | 设置绝对定位的锚点,以安全组件的左上角作为基准点进行偏移。
默认值:
{
x: 0,
y: 0
} | -| offset | [Position](ts-types.md#position8) | 否 | 设置相对定位,安全组件相对于自身的偏移量。
默认值:
{
x: 0,
y: 0
} | -| fontSize | [Length](ts-types.md#length) | 否 | 设置安全组件上文字的尺寸。
默认值:16fp | -| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 否 | 设置安全组件上文字的样式。
默认值:FontStyle.Normal | -| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 否 | 设置安全组件上文字粗细。
默认值:FontWeight.Medium | -| fontFamily | string \| [Resource](ts-types.md#resource类型) | 否 | 设置安全组件上文字的字体。
默认字体:'HarmonyOS Sans' | -| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上文字的颜色。
默认值:#ffffffff | -| iconColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上图标的颜色。
默认值:#ffffffff | -| backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的背景颜色。
默认值:#007dff | -| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 设置安全组件的边框的样式。
默认不设置边框样式 | -| borderWidth | [Length](ts-types.md#length) | 否 | 设置安全组件的边框的宽度。
默认不设置边框宽度 | -| borderColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的边框的颜色。
默认不设置边框颜色 | -| borderRadius | [Length](ts-types.md#length) | 否 | 设置安全组件的边框圆角半径。
默认值:1/2 按钮整高 | -| padding | [Padding](ts-types.md#padding) \| [Length](ts-types.md#length) | 否 | 设置安全组件的内边距。
默认值:上下8vp, 左右24vp | -| textIconSpace | [Length](ts-types.md#length) | 否 | 设置安全组件中图标和文字的间距。
默认值:4vp | +| 名称 | 参数类型 | 必填 | 描述 | +| --------------- | ---------------------------------------- | ---- | ---------------------------------------- | +| iconSize | [Length](ts-types.md#length) | 否 | 设置安全组件上图标的尺寸。
默认值:16vp | +| layoutDirection | [SecurityComponentLayoutDirection](#securitycomponentlayoutdirection枚举说明) | 否 | 设置安全组件上图标和文字分布的方向。
默认值:SecurityComponentLayoutDirection.HORIZONTAL | +| layoutOrder | [SecurityComponentLayoutOrder](#securitycomponentlayoutorder枚举说明) | 否 | 设置安全组件上图标和文字分布的顺序。
默认值:SecurityComponentLayoutOrder.ICON_FIRST | +| position | [Position](ts-types.md#position8) | 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。
默认值:
{
x: 0,
y: 0
} | +| markAnchor | [Position](ts-types.md#position8) | 否 | 设置绝对定位的锚点,以安全组件的左上角作为基准点进行偏移。
默认值:
{
x: 0,
y: 0
} | +| offset | [Position](ts-types.md#position8) | 否 | 设置相对定位,安全组件相对于自身的偏移量。
默认值:
{
x: 0,
y: 0
} | +| fontSize | [Length](ts-types.md#length) | 否 | 设置安全组件上文字的尺寸。
默认值:16fp | +| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 否 | 设置安全组件上文字的样式。
默认值:FontStyle.Normal | +| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 否 | 设置安全组件上文字粗细。
默认值:FontWeight.Medium | +| fontFamily | string \| [Resource](ts-types.md#resource类型) | 否 | 设置安全组件上文字的字体。
默认字体:'HarmonyOS Sans' | +| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上文字的颜色。
默认值:#ffffffff | +| iconColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件上图标的颜色。
默认值:#ffffffff | +| backgroundColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的背景颜色。
默认值:#007dff | +| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | 设置安全组件的边框的样式。
默认不设置边框样式 | +| borderWidth | [Length](ts-types.md#length) | 否 | 设置安全组件的边框的宽度。
默认不设置边框宽度 | +| borderColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 设置安全组件的边框的颜色。
默认不设置边框颜色 | +| borderRadius | [Length](ts-types.md#length) | 否 | 设置安全组件的边框圆角半径。
默认值:1/2 按钮整高 | +| padding | [Padding](ts-types.md#padding) \| [Length](ts-types.md#length) | 否 | 设置安全组件的内边距。
默认值:上下8vp, 左右24vp | +| textIconSpace | [Length](ts-types.md#length) | 否 | 设置安全组件中图标和文字的间距。
默认值:4vp | ## SecurityComponentLayoutDirection枚举说明 -| 名称 | 描述 | -| ------------------- | ------------------ | -| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 | -| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 | +| 名称 | 描述 | +| ---------- | --------------------- | +| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 | +| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 | ## SecurityComponentLayoutOrder枚举说明 -| 名称 | 描述 | -| ------------------- | ------------------ | -| ICON_FIRST | 图标的排列顺序先于文字。 | +| 名称 | 描述 | +| ---------- | ------------ | +| ICON_FIRST | 图标的排列顺序先于文字。 | | TEXT_FIRST | 文字的排列顺序先于图标。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md index 3cd1617601ff2bd83cc79b17ccb78e05868ab016..55e901fe2362de3b929c272671142e1f9f1c3e00 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md @@ -1,23 +1,23 @@ -# 文本通用属性 +# 文本通用 文本通用属性目前只针对包含文本元素的组件,设置文本样式。 > **说明:** > -> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 +> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 ## 属性 -| 名称 | 参数类型 | 描述 | -| -----------| ---------------------------------------- | ------------------------------------ | -| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 设置字体颜色。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| fontSize | [Length](ts-types.md#length) | 设置字体大小,Length为number类型时,使用fp单位。字体默认大小16。不支持设置百分比字符串。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 设置字体样式。
默认值:FontStyle.Normal
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。
默认值:FontWeight.Normal
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| fontFamily | string \| [Resource](ts-types.md#resource) | 设置字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| 名称 | 参数类型 | 描述 | +| ---------- | ---------------------------------------- | ---------------------------------------- | +| fontColor | [ResourceColor](ts-types.md#resourcecolor) | 设置字体颜色。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| fontSize | [Length](ts-types.md#length) | 设置字体大小,Length为number类型时,使用fp单位。字体默认大小16。不支持设置百分比字符串。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | 设置字体样式。
默认值:FontStyle.Normal
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| fontWeight | number \| [FontWeight](ts-appendix-enums.md#fontweight) \| string | 设置文本的字体粗细,number类型取值[100, 900],取值间隔为100,默认为400,取值越大,字体越粗。string类型仅支持number类型取值的字符串形式,例如"400",以及"bold"、"bolder"、"lighter"、"regular"、"medium",分别对应FontWeight中相应的枚举值。
默认值:FontWeight.Normal
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| fontFamily | string \| [Resource](ts-types.md#resource) | 设置字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | lineHeight | string \| number \| [Resource](ts-types.md#resource) | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | decoration | {
type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),
color?: [ResourceColor](ts-types.md#resourcecolor)
} | 设置文本装饰线样式及其颜色。
默认值:{
type: TextDecorationType.None,
color:Color.Black
}
从API version 9开始,该接口支持在ArkTS卡片中使用。 |