Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
cc4ed7bd
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cc4ed7bd
编写于
6月 27, 2023
作者:
H
HelloCrease
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
HelloCrease
<
lian15@huawei.com
>
上级
b62540e1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
38 deletion
+38
-38
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-securitycomponent.md
...nce/arkui-ts/ts-universal-attributes-securitycomponent.md
+29
-29
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md
.../reference/arkui-ts/ts-universal-attributes-text-style.md
+9
-9
未找到文件。
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-securitycomponent.md
浏览文件 @
cc4ed7bd
# 安全组件通用
属性
# 安全组件通用
安全组件的基础属性,用于设置安全组件通用的属性。
安全组件的基础属性,用于设置安全组件通用的属性。
...
@@ -8,40 +8,40 @@
...
@@ -8,40 +8,40 @@
## 属性
## 属性
| 名称
| 参数类型
| 必填 | 描述 |
| 名称
| 参数类型
| 必填 | 描述 |
| -----------
|
------ | ---- | ---------------------------------------- |
| -----------
---- | ----------------------------------
------ | ---- | ---------------------------------------- |
| iconSize
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件上图标的尺寸。
<br/>
默认值:16vp
|
| iconSize
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件上图标的尺寸。
<br/>
默认值:16vp
|
| layoutDirection
|
[
SecurityComponentLayoutDirection
](
#securitycomponentlayoutdirection枚举说明
)
| 否 | 设置安全组件上图标和文字分布的方向。
<br/>
默认值:SecurityComponentLayoutDirection.HORIZONTAL
|
| layoutDirection
|
[
SecurityComponentLayoutDirection
](
#securitycomponentlayoutdirection枚举说明
)
| 否 | 设置安全组件上图标和文字分布的方向。
<br/>
默认值:SecurityComponentLayoutDirection.HORIZONTAL
|
| layoutOrder
|
[
SecurityComponentLayoutOrder
](
#securitycomponentlayoutorder枚举说明
)
| 否 | 设置安全组件上图标和文字分布的顺序。
<br/>
默认值:SecurityComponentLayoutOrder.ICON_FIRST
|
| layoutOrder
|
[
SecurityComponentLayoutOrder
](
#securitycomponentlayoutorder枚举说明
)
| 否 | 设置安全组件上图标和文字分布的顺序。
<br/>
默认值:SecurityComponentLayoutOrder.ICON_FIRST
|
| position
|
[
Position
](
ts-types.md#position8
)
| 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。
<br/>
默认值:
<br/>
{
<br/>
x: 0,
<br/>
y: 0
<br/>
} |
| position
|
[
Position
](
ts-types.md#position8
)
| 否 | 设置绝对定位,设置安全组件的左上角相对于父容器左上角的偏移位置。
<br/>
默认值:
<br/>
{
<br/>
x: 0,
<br/>
y: 0
<br/>
} |
| markAnchor
|
[
Position
](
ts-types.md#position8
)
| 否 | 设置绝对定位的锚点,以安全组件的左上角作为基准点进行偏移。
<br/>
默认值:
<br/>
{
<br/>
x: 0,
<br/>
y: 0
<br/>
} |
| markAnchor
|
[
Position
](
ts-types.md#position8
)
| 否 | 设置绝对定位的锚点,以安全组件的左上角作为基准点进行偏移。
<br/>
默认值:
<br/>
{
<br/>
x: 0,
<br/>
y: 0
<br/>
} |
| offset
|
[
Position
](
ts-types.md#position8
)
| 否 | 设置相对定位,安全组件相对于自身的偏移量。
<br/>
默认值:
<br/>
{
<br/>
x: 0,
<br/>
y: 0
<br/>
} |
| offset
|
[
Position
](
ts-types.md#position8
)
| 否 | 设置相对定位,安全组件相对于自身的偏移量。
<br/>
默认值:
<br/>
{
<br/>
x: 0,
<br/>
y: 0
<br/>
} |
| fontSize
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件上文字的尺寸。
<br/>
默认值:16fp
|
| fontSize
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件上文字的尺寸。
<br/>
默认值:16fp
|
| fontStyle |
[
FontStyle
](
ts-appendix-enums.md#fontstyle
)
| 否 | 设置安全组件上文字的样式。
<br/>
默认值:FontStyle.Normal |
| fontStyle
|
[
FontStyle
](
ts-appendix-enums.md#fontstyle
)
| 否 | 设置安全组件上文字的样式。
<br/>
默认值:FontStyle.Normal |
| fontWeight
| number
\|
[
FontWeight
](
ts-appendix-enums.md#fontweight
)
\|
string | 否
| 设置安全组件上文字粗细。
<br/>
默认值:FontWeight.Medium |
| fontWeight
| number
\|
[
FontWeight
](
ts-appendix-enums.md#fontweight
)
\|
string | 否
| 设置安全组件上文字粗细。
<br/>
默认值:FontWeight.Medium |
| fontFamily | string
\|
[
Resource
](
ts-types.md#resource类型
)
| 否 | 设置安全组件上文字的字体。
<br/>
默认字体:'HarmonyOS Sans' |
| fontFamily
| string
\|
[
Resource
](
ts-types.md#resource类型
)
| 否 | 设置安全组件上文字的字体。
<br/>
默认字体:'HarmonyOS Sans' |
| fontColor
|
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件上文字的颜色。
<br/>
默认值:#ffffffff
|
| fontColor
|
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件上文字的颜色。
<br/>
默认值:#ffffffff
|
| iconColor
|
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件上图标的颜色。
<br/>
默认值:#ffffffff
|
| iconColor
|
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件上图标的颜色。
<br/>
默认值:#ffffffff
|
| backgroundColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件的背景颜色。
<br/>
默认值:#007dff |
| backgroundColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件的背景颜色。
<br/>
默认值:#007dff
|
| borderStyle
|
[
BorderStyle
](
ts-appendix-enums.md#borderstyle
)
| 否 | 设置安全组件的边框的样式。
<br/>
默认不设置边框样式
|
| borderStyle
|
[
BorderStyle
](
ts-appendix-enums.md#borderstyle
)
| 否 | 设置安全组件的边框的样式。
<br/>
默认不设置边框样式
|
| borderWidth
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件的边框的宽度。
<br/>
默认不设置边框宽度
|
| borderWidth
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件的边框的宽度。
<br/>
默认不设置边框宽度
|
| borderColor
|
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件的边框的颜色。
<br/>
默认不设置边框颜色
|
| borderColor
|
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 设置安全组件的边框的颜色。
<br/>
默认不设置边框颜色
|
| borderRadius
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件的边框圆角半径。
<br/>
默认值:1/2 按钮整高
|
| borderRadius
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件的边框圆角半径。
<br/>
默认值:1/2 按钮整高
|
| padding
|
[
Padding
](
ts-types.md#padding
)
\|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件的内边距。
<br/>
默认值:上下8vp, 左右24vp
|
| padding
|
[
Padding
](
ts-types.md#padding
)
\|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件的内边距。
<br/>
默认值:上下8vp, 左右24vp
|
| textIconSpace
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件中图标和文字的间距。
<br/>
默认值:4vp
|
| textIconSpace
|
[
Length
](
ts-types.md#length
)
| 否 | 设置安全组件中图标和文字的间距。
<br/>
默认值:4vp
|
## SecurityComponentLayoutDirection枚举说明
## SecurityComponentLayoutDirection枚举说明
| 名称
| 描述
|
| 名称
| 描述
|
| ----------
--------- |
------------------ |
| ----------
| ---
------------------ |
| HORIZONTAL
| 安全组件上图标和文字分布的方向为水平排列。 |
| HORIZONTAL | 安全组件上图标和文字分布的方向为水平排列。 |
| VERTICAL | 安全组件上图标和文字分布的方向为垂直排列。 |
| VERTICAL
| 安全组件上图标和文字分布的方向为垂直排列。 |
## SecurityComponentLayoutOrder枚举说明
## SecurityComponentLayoutOrder枚举说明
| 名称
| 描述
|
| 名称
| 描述
|
| ----------
--------- | ------
------------ |
| ----------
|
------------ |
| ICON_FIRST
| 图标的排列顺序先于文字。 |
| ICON_FIRST | 图标的排列顺序先于文字。 |
| TEXT_FIRST | 文字的排列顺序先于图标。 |
| TEXT_FIRST | 文字的排列顺序先于图标。 |
## 示例
## 示例
...
...
zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-text-style.md
浏览文件 @
cc4ed7bd
# 文本通用
属性
# 文本通用
文本通用属性目前只针对包含文本元素的组件,设置文本样式。
文本通用属性目前只针对包含文本元素的组件,设置文本样式。
> **说明:**
> **说明:**
>
>
> 从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
>
从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
## 属性
## 属性
| 名称 | 参数类型
| 描述
|
| 名称 | 参数类型
| 描述
|
| ----------
-| ---------------------------------------- |
------------------------------------ |
| ----------
| ---------------------------------------- | ----
------------------------------------ |
| fontColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 设置字体颜色。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontColor |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 设置字体颜色。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontSize |
[
Length
](
ts-types.md#length
)
| 设置字体大小,Length为number类型时,使用fp单位。字体默认大小16。不支持设置百分比字符串。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontSize |
[
Length
](
ts-types.md#length
)
| 设置字体大小,Length为number类型时,使用fp单位。字体默认大小16。不支持设置百分比字符串。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontStyle |
[
FontStyle
](
ts-appendix-enums.md#fontstyle
)
| 设置字体样式。
<br>
默认值:FontStyle.Normal
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontStyle |
[
FontStyle
](
ts-appendix-enums.md#fontstyle
)
| 设置字体样式。
<br>
默认值:FontStyle.Normal
<br/>
从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中相应的枚举值。
<br/>
默认值:FontWeight.Normal
<br/>
从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中相应的枚举值。
<br/>
默认值:FontWeight.Normal
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontFamily | string
\|
[
Resource
](
ts-types.md#resource
)
| 设置字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| fontFamily | string
\|
[
Resource
](
ts-types.md#resource
)
| 设置字体列表。默认字体'HarmonyOS Sans',且当前只支持这种字体。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| lineHeight | string
\|
number
\|
[
Resource
](
ts-types.md#resource
)
| 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| lineHeight | string
\|
number
\|
[
Resource
](
ts-types.md#resource
)
| 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| decoration | {
<br/>
type:
[TextDecorationType](ts-appendix-enums.md#textdecorationtype),
<br/>
color?:
[
ResourceColor
](
ts-types.md#resourcecolor
)
<br/>
} | 设置文本装饰线样式及其颜色。
<br
/>
默认值:{
<br/>
type:
TextDecorationType.None,
<br/>
color:Color.Black
<br/>
}
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| decoration | {
<br/>
type:
[TextDecorationType](ts-appendix-enums.md#textdecorationtype),
<br/>
color?:
[
ResourceColor
](
ts-types.md#resourcecolor
)
<br/>
} | 设置文本装饰线样式及其颜色。
<br
/>
默认值:{
<br/>
type:
TextDecorationType.None,
<br/>
color:Color.Black
<br/>
}
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录