Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
181e8c17
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
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看板
提交
181e8c17
编写于
3月 13, 2023
作者:
Z
zhouliting
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add attribute
Signed-off-by:
N
zhouliting
<
zhouliting5@huawei.com
>
上级
85f5538d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
14 deletion
+7
-14
zh-cn/application-dev/reference/arkui-ts/figures/richText.png
...n/application-dev/reference/arkui-ts/figures/richText.png
+0
-0
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-richtext.md
...on-dev/reference/arkui-ts/ts-basic-components-richtext.md
+7
-14
未找到文件。
zh-cn/application-dev/reference/arkui-ts/figures/richText.png
查看替换文件 @
85f5538d
浏览文件 @
181e8c17
26.0 KB
|
W:
|
H:
69.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-richtext.md
浏览文件 @
181e8c17
...
...
@@ -33,13 +33,7 @@ RichText(content:string)
## 属性
| 名称 | 参数说明 | 描述 |
| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| width |
[
Length
](
ts-types.md#length
)
| 设置组件自身的宽度,缺省时使用元素自身内容需要的宽度。若子组件的宽大于父组件的宽,子组件则会画出父组件的范围。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| height |
[
Length
](
ts-types.md#length
)
| 设置组件自身的高度,缺省时使用元素自身内容需要的高度。若子组件的高大于父组件的高,子组件则会画出父组件的范围。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| size | {
<br/>
width?:
[Length](ts-types.md#length),
<br/>
height?:
[
Length
](
ts-types.md#length
)
<br/>
} | 设置高宽尺寸。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| margin |
[
Margin
](
ts-types.md#margin
)
\|
[
Length
](
ts-types.md#length
)
| 设置外边距属性。
<br/>
参数为Length类型时,四个方向外边距同时生效。
<br>
默认值:0
<br>
margin设置百分比时,上下左右外边距均以父容器的width作为基础值。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| layoutWeight | number
\|
string | 父容器尺寸确定时,设置了layoutWeight属性的子元素与兄弟元素占主轴尺寸按照权重进行分配,忽略元素本身尺寸设置,表示自适应占满剩余空间。
<br>
**说明:**
<br/>
仅在Row/Column/Flex布局中生效。
<br/>
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
只支持
[
通用属性
](
ts-universal-attributes-size.md
)
中width,height,size,layoutWeight四个属性。由于padding,margin,constraintSize属性使用时与通用属性描述不符,暂不支持。
## 支持标签
...
...
@@ -88,9 +82,9 @@ struct RichTextExample {
.
onComplete
(()
=>
{
console
.
info
(
'
RichText onComplete
'
);
})
.
width
(
4
00
)
.
width
(
5
00
)
.
height
(
400
)
.
margin
(
20
)
.
backgroundColor
(
0XBDDB69
)
RichText
(
'
layoutWeight(1)
'
)
.
onStart
(()
=>
{
console
.
info
(
'
RichText onStart
'
);
...
...
@@ -98,10 +92,9 @@ struct RichTextExample {
.
onComplete
(()
=>
{
console
.
info
(
'
RichText onComplete
'
);
})
.
size
({
width
:
'
3
0%
'
,
height
:
110
})
.
backgroundColor
(
Color
.
Blue
)
.
size
({
width
:
'
10
0%
'
,
height
:
110
})
.
backgroundColor
(
0X92D6CC
)
.
layoutWeight
(
1
)
RichText
(
'
layoutWeight(2)
'
)
.
onStart
(()
=>
{
console
.
info
(
'
RichText onStart
'
);
...
...
@@ -109,8 +102,8 @@ struct RichTextExample {
.
onComplete
(()
=>
{
console
.
info
(
'
RichText onComplete
'
);
})
.
size
({
width
:
'
3
0%
'
,
height
:
110
})
.
backgroundColor
(
Color
.
Yellow
)
.
size
({
width
:
'
10
0%
'
,
height
:
110
})
.
backgroundColor
(
0X92C48D
)
.
layoutWeight
(
2
)
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录