读书人

暗藏键盘二-隐藏的同时还要接受其他事

发布时间: 2012-08-28 12:37:01 作者: rapoo

隐藏键盘二-----隐藏的同时还要接受其他事件

在隐藏键盘一中 忘了说了 要加一句

android:configChanges="orientation|keyboardHidden"

这样键盘就是一直隐藏的。

可是如果我像隐藏键盘 还想只接受数字呢:

EditText editText = (EditText) findViewById(R.id.edt_hello); editText.setKeyListener(new NumberKeyListener() { @Override public int getInputType() { return InputType.TYPE_NULL; } @Override protected char[] getAcceptedChars() { return new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; } });

?

?

读书人网 >移动开发

热点推荐