Text无法实现此功能,可以使用TextArea的maxLines,TextArea的maxLines属性作用是设置内联输入风格编辑态时文本可显示的最大行数。设置TextArea组件的样式为内联样式时生效:style(TextContentStyle.INLINE)TextArea的maxLines属性说明文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-textarea-V5\#属性
Text无法实现此功能,可以使用TextArea的maxLines,TextArea的maxLines属性作用是设置内联输入风格编辑态时文本可显示的最大行数。设置TextArea组件的样式为内联样式时生效:style(TextContentStyle.INLINE)
TextArea的maxLines属性说明文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-textarea-V5\#属性