HarmonyOS RichEditor 内容不居中显示

HarmonyOS RichEditor 内容不居中显示。

HarmonyOS
2024-11-28 09:12:48
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
shlp

参考代码:

RichEditor({ controller: this.controllerRich}) 
  .width('100%') 
  .height(40) 
  .layoutWeight(1) 
  .borderRadius(10) 
  .backgroundColor(Color.Red) 
  .margin({ top: 20 ,left:14,bottom:5}) 
  .key('RichEditor') 
  .id('id') 
  .placeholder('平台提倡文明用语,请温柔发言哦~',{font:{size:12},fontColor:'#999999'}) 
  .defaultFocus(true) 
  .onReady(() => { 
    this.controllerRich.addTextSpan("0123456789\n", { 
      style: { 
        fontColor: Color.Pink, 
        fontSize: "32", 
      }, 
      paragraphStyle: { 
        textAlign: TextAlign.Center, 
        leadingMargin: 16 
      } 
    }) 
  })
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.

​参考文档:​https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-richeditor-V5

分享
微博
QQ
微信
回复
2024-11-28 15:39:44
相关问题
HarmonyOS 如何设置RichEditor字体居中
666浏览 • 1回复 待解决
HarmonyOS RichEditor内容高出能否滚动?
709浏览 • 1回复 待解决
HarmonyOS Text设置align居中
1146浏览 • 1回复 待解决
HarmonyOS bindsheet弹出居中弹框
644浏览 • 1回复 待解决
HarmonyOS 文字在Row中居中
726浏览 • 1回复 待解决
HarmonyOS 组件剩余区域居中显示
573浏览 • 1回复 待解决
HarmonyOS Navigation中title怎么居中显示
847浏览 • 1回复 待解决
HarmonyOS RichEditor粘贴内容不会有回调
772浏览 • 1回复 待解决
HarmonyOS 文字行高设定后文字居中
1021浏览 • 1回复 待解决
HarmonyOS AlertDialog的title能居中显示
589浏览 • 1回复 待解决
HarmonyOS webloadData不显示内容
610浏览 • 1回复 待解决