现在的位置: 首页 > 综合 > 正文

EditText的显示和隐藏

2013年08月07日 ⁄ 综合 ⁄ 共 326字 ⁄ 字号 评论关闭

EditText ed = new EditText(context);
InputMethodManager mInputMethodManager = ((InputMethodManager) context
.getSystemService(context.INPUT_METHOD_SERVICE));
隐藏
mInputMethodManager.hideSoftInputFromWindow(ed.getWindowToken(),0);
展示
ed.setInputType(InputType.TYPE_DATETIME_VARIATION_NORMAL);
mInputMethodManager.showSoftInput(ed, 0); 

【上篇】
【下篇】

抱歉!评论已关闭.