您的位置:首页 > 移动开发 > Android开发

Android,隐藏/显示软键盘

2014-03-17 09:47 232 查看
---------隐藏软键盘

InputMethodManager imm = (InputMethodManager)getSystemService(getApplication().INPUT_METHOD_SERVICE);

imm.hideSoftInputFromWindow(DialogShow.this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);

---------显示软键盘,控件ID可以是EditText,TextView

InputMethodManager imm = (InputMethodManager)getSystemService(getApplication().INPUT_METHOD_SERVICE);

imm.showSoftInput(控件ID, 0);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: