本文介绍了隐藏虚拟键盘总是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实我有一个编辑text.when我点击编辑文本虚拟键盘popups.But我只是想隐藏虚拟键盘随时点击编辑text.And编辑文本即使要打印与系统I keyboard.How能做到这一点?
我的code ..

 的EditText edtNote =(EditText上)findViewById(R.id.note);
InputMethodManager IMM =(InputMethodManager)this.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.restartInput(edtNote);配置配置= this.getResources()getConfiguration()。如果(config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES){
    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
}


解决方案

尝试edtNote.setInputType(InputType.Type_Null);它有优点也有缺点。
Android的习惯对待元素作为输入元素。你不能进入之后的事

Actually i have a edit text.when i click edit text virtual keyboard popups.But i just wanna hide virtual keyboard always even after click on edit text.And edit text should be printable with system keyboard.How could i do this?My code..

EditText edtNote = (EditText)findViewById(R.id.note);
InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.restartInput(edtNote);

Configuration config = this.getResources().getConfiguration();

if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES) {
    imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}
解决方案

Try edtNote.setInputType(InputType.Type_Null); it has advantages and disadvantage.Android wont treat the element as an input element. You cant enter anything after this

这篇关于隐藏虚拟键盘总是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 22:15
查看更多