[英]How to hide keyboard when touching on the EditText in Android Studio
我是这个论坛的新手,这是我的第一个问题!
我有一个使用Android Studio 1.1.0在Android上制作计算器的项目。
问题是如何隐藏键盘在EditText上(但仍保持光标显示) ?
感谢大家 !!!
好吧,您可以使用以下方法: InputMethodManager input = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); input.hideSoftInputFromWindow(EditText1.getWindowToken(), 0);
InputMethodManager input = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); input.hideSoftInputFromWindow(EditText1.getWindowToken(), 0);
其中editText1是输入文本字段的名称.....它将隐藏键盘,您可以使用按钮在editText中获取计算器的数字。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.