HarmonyOS RichEditor预输入组件高度不变化

RichEditor在拼音预输入时,不会适配改变高度,那部分会显示在外部,文字彻底输入后才会改变高度,这个能不能在预输入时就扩展适配下高度

@Entry
@Component
struct Index {
  @State message: string = 'Hello World';
  private richEditorController: RichEditorController = new RichEditorController();
  private options: RichEditorOptions = { controller: this.richEditorController };

  build() {
    Row() {
      Stack({
        alignContent: Alignment.Center
      }) {
        RichEditor(this.options)
          .border({ width: 1, color: Color.Green })
          .padding(0)
          .width("100%")
      }
      .backgroundColor("#14161823")
      .border({ width: 1, color: Color.Red })
      .layoutWeight(1)
      .constraintSize({
        minHeight: 40
      })
      .borderRadius(20)
      .padding({
        left: 8,
        right: 8,
        top: 8,
        bottom: 8
      })
      .margin({
        left: 12,
        right: 12,
        top: 6,
        bottom: 6
      })
      .height("auto")
      .width("100%")

      Text("发送")
        .borderRadius(25)
        .backgroundColor("#57FE2C55")
        .fontColor(Color.White)
        .fontSize(13)
        .textAlign(TextAlign.Center)
        .height(30)
        .width(50)
        .margin({
          right: 17
        })
    }
    .constraintSize({
      minHeight: 56
    })
    .width("100%")
    .backgroundColor(Color.White)
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
HarmonyOS
2024-12-25 08:15:34
1565浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
put_get

当前问题是RichEditor已经可以预输入改变高度了,是外层的Stack没有变化,使用高度监听内部RichEditor的高度变化,然后同步给外面的Stack即可

分享
微博
QQ
微信
回复
2024-12-25 10:07:14


相关问题
HarmonyOS RichEditor如何控制输入状态
769浏览 • 1回复 待解决
HarmonyOS 控件高度随滚动变化
908浏览 • 1回复 待解决
鸿蒙如何监听键盘高度变化
352浏览 • 1回复 待解决
HarmonyOS 页面高度发生变化
935浏览 • 1回复 待解决
如何监听输入输入内容的变化
1322浏览 • 1回复 待解决
HarmonyOS list嵌套tab中列表高度变化
719浏览 • 1回复 待解决
HarmonyOS加载Image组件的图片
1425浏览 • 1回复 待解决
TabContent组件是否支持加载
2791浏览 • 1回复 待解决
HarmonyOS 输入法的高度是如何确定的?
1393浏览 • 1回复 待解决
HarmonyOS 密码输入组件
606浏览 • 1回复 待解决