diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-richtext.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-richtext.md
index df664f36657ffc9c9cfddf3689d9188a5680dac5..919b43955111a419b2669ac6bdc761cf9d0f0771 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-richtext.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-richtext.md
@@ -38,7 +38,6 @@ RichText(content:string)
| width | [Length](ts-types.md#length) | 设置组件自身的宽度,缺省时使用元素自身内容需要的宽度。若子组件的宽大于父组件的宽,则会画出父组件的范围。
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| height | [Length](ts-types.md#length) | 设置组件自身的高度,缺省时使用元素自身内容需要的高度。若子组件的高大于父组件的高,则会画出父组件的范围。
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| size | {
width?: [Length](ts-types.md#length),
height?: [Length](ts-types.md#length)
} | 设置高宽尺寸。
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
-| padding | [Padding](ts-types.md#padding) \| [Length](ts-types.md#length) | 设置内边距属性。
参数为Length类型时,四个方向内边距同时生效。
默认值:0
padding设置百分比时,上下左右内边距均以父容器的width作为基础值。
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| margin | [Margin](ts-types.md#margin) \| [Length](ts-types.md#length) | 设置外边距属性。
参数为Length类型时,四个方向外边距同时生效。
默认值:0
margin设置百分比时,上下左右外边距均以父容器的width作为基础值。
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
| layoutWeight | number \| string | 父容器尺寸确定时,设置了layoutWeight属性的子元素与兄弟元素占主轴尺寸按照权重进行分配,忽略元素本身尺寸设置,表示自适应占满剩余空间。
**说明:**
仅在Row/Column/Flex布局中生效。
从API version 9开始,该接口支持在ArkTS卡片中使用。 |
@@ -89,6 +88,30 @@ struct RichTextExample {
.onComplete(() => {
console.info('RichText onComplete');
})
+ .width(80)
+ .height(80)
+ .margin(20)
+ }
+ Row() {
+ RichText('layoutWeight(1)')
+ .onStart(() => {
+ console.info('RichText onStart');
+ })
+ .onComplete(() => {
+ console.info('RichText onComplete');
+ })
+ .size({ width: '30%', height: 110 })
+ .layoutWeight(2)
+
+ RichText('layoutWeight(2)')
+ .onStart(() => {
+ console.info('RichText onStart');
+ })
+ .onComplete(() => {
+ console.info('RichText onComplete');
+ })
+ .size({ width: '30%', height: 110 })
+ .layoutWeight(2)
}
}
}