HarmonyOS RichEditor 如何设置默认的输入的字体大小?

RichEditor 如何设置默认的输入的字体大小。颜色。类似fontSize fontColor一样。

阅读 387
1 个回答

参考demo

@Entry
@Component
struct setTypingStyle {
  editorController: RichEditorController = new RichEditorController()
  build() {
    Column() {
      RichEditor({ controller: this.editorController })
        .padding(0)
        .width(300)
        .height(180)
        .backgroundColor(Color.Yellow)
        .onReady(() => {
          this.editorController.setTypingStyle({
            fontSize: 30,
            fontColor: Color.Red
          })
        })
    }
  }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进