我想隐藏EditText上的软键盘,即使在'点击'时也是如此。我的意思是说在我的活动中不应该有可见的软键盘,因为我有自己的键盘来输入数据。 请帮我...谢谢...如何隐藏EditText上的软键盘
0
A
回答
3
editText_input_field.setOnTouchListener(otl);
private OnTouchListener otl = new OnTouchListener() {
public boolean onTouch (View v, MotionEvent event) {
return true; // the listener has consumed the event
}
};
来源:how to block virtual keyboard while clicking on edittext in android?
+1
这是很好的,在这里我们必须把重点放在指定的视图,这就是为什么我们必须得到这个请求。所以最好在上面加上'((EditText)v).requestFocus()'return true;' – Noundla 2012-04-12 11:27:30
+0
没有@Noundla的评论编辑框将不会专注于触摸 – 2017-04-18 23:59:00
1
0
粘贴如下代码下的EditText XML文件标签
android:textIsSelectable="true"
可能重复[How t o关闭/隐藏Android软键盘?](http://stackoverflow.com/questions/1109022/how-to-close-hide-the-android-soft-keyboard) – 2012-04-12 10:20:54
@Adil Soomro,我无法获得从该链接解决方案...仍然软键盘是可见的,当我点击edittext ... – Noundla 2012-04-12 11:02:51
看到这篇文章http://stackoverflow.com/a/1109108/985143 – 2012-04-12 10:16:05