可以通过align属性传入参数Alignment.TopStart,来设置光标位置位于左上角。示例代码如下:// xxx.ets @Entry @Component struct RichEditorExample { controller: RichEditorController = new RichEditorController(); build() { Column() { RichEditor({ controller: this.controller }) .align(Alignment.TopStart) // 设置光标的起始位置位于左上角 .height(200) .borderWidth(1) .borderColor(Color.Red) .width('100%') } } }
可以通过align属性传入参数Alignment.TopStart,来设置光标位置位于左上角。示例代码如下: