android自动弹出软键盘(输入键盘)
2014-07-28 18:19
281 查看
[代码]java代码
EditText editText.setFocusable( true ); |
editText.setFocusableInTouchMode( true ); |
editText.requestFocus(); |
InputMethodManager inputManager = |
(InputMethodManager)editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
inputManager.showSoftInput(editText, 0 ); |
警告:对于刚跳到一个新的界面就要弹出软键盘的情况上述代码可能由于界面为加载完全而无法弹出软键盘。此时应该适当的延迟弹出软键盘如998毫秒(保证界面的数据加载完成)。实例代码如下:
[代码]java代码:
Timer timer = new Timer(); |
timer.schedule( new TimerTask() |
{ |
public void run() |
{ |
InputMethodManager inputManager = |
(InputMethodManager)editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); |
inputManager.showSoftInput(editText, 0 ); |
} |
}, |
998 ); |
相关文章推荐
- android自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- android editText自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- Android 自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- Android是一个针对触摸屏专门设计的操作系统,当点击编辑框,系统自动为用户弹出软键盘,以便用户进行输入。 那么,弹出软键盘后必然会造成原有布局高度的减少,那么系统应该如何来处理布局的减少
- android自动弹出软键盘(输入键盘)
- android 自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- android自动弹出软键盘(输入键盘)
- Android 中使 EditText 失去焦点,禁止弹出软键盘,及 弹出软键盘后 EditText 自动上移 不致被遮挡
- android隐藏以及显示软键盘以及不自动弹出键盘的方法
- android中隐藏与显示软键盘及不自动弹出键盘及软键盘将布局顶上去的实现方法
- 解析android中隐藏与显示软键盘及不自动弹出键盘的实现方法
- Android隐藏以及显示软键盘以及不自动弹出键盘的方法