简体   繁体   English

当用户点击进入/完成时,以编程方式关闭虚拟键盘

[英]Close Virtual Keyboard programmatically when user hits enter/done

I'm currently developing an Angular App that is meant to run on tablets. 我目前正在开发一款适用于平板电脑的Angular应用程序。 I have a fake form composed of different lines with a textfield each. 我有一个假的表单,由不同的行组成,每个行都有一个textfield。 I want that when the user types a value inside one of those fields and hits enter the keyboard closes until he hits again a textfield. 我希望当用户在这些字段之一中键入一个值并单击时,键盘关闭直到他再次单击文本字段。 Something like: "touch field -> open keyboard -> insert value -> hit enter -> hide keyboard". 诸如:“触摸字段->打开键盘->插入值->按下Enter->隐藏键盘”。

Is this possible or is a built-in behavior of Android and it is not avoidable? 这是可能的还是Android的内置行为,这是不可避免的?

您可以尝试手动调度事件,也可以将字段变为只读,直到再次单击该字段/重新对其进行聚焦或类似操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM