你可以给外层容器添加个点击事件,在点击事件中调用controller.stopEditing()方法移除输入框焦点即可隐藏键盘@Entry @Component struct TextInputExample { controller: TextInputController = new TextInputController(); build() { Column() { TextInput({ controller: this.controller }) } .width('100%') .height('100%') .onClick(()=>{ this.controller.stopEditing(); }) } }本文参与了 【 HarmonyOS NEXT 技术问答冲榜,等你来战!】欢迎正在阅读的你也加入。
你可以给外层容器添加个点击事件,在点击事件中调用controller.stopEditing()方法移除输入框焦点即可隐藏键盘
本文参与了 【 HarmonyOS NEXT 技术问答冲榜,等你来战!】欢迎正在阅读的你也加入。