可以通过stopediting退出软件盘的编辑状态,可参考如下代码:@Entry @Component struct TextInputExample { controller: TextInputController = new TextInputController() @State inputValue: string = “” build() { Column() { TextInput({ text: this.inputValue, placeholder: ‘input your word…’, controller: this.controller }) .placeholderColor(Color.Grey) .placeholderFont({ size: 14, weight: 400 }) .caretColor(Color.Blue) .width(‘95%’) .height(40) .margin(20) .fontSize(14) .fontColor(Color.Black) .onChange((value: string) => { this.inputValue = value }) } .width(‘100%’) .height(‘100%’) .onClick(()=>{ this.controller.stopEditing() }) } }
可以通过stopediting退出软件盘的编辑状态,可参考如下代码: