隐藏键盘二-----隐藏的同时还要接受其他事件
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
在隐藏键盘一中 忘了说了 要加一句
android:configChanges="orientation|keyboardHidden"
这样键盘就是一直隐藏的。
可是如果我像隐藏键盘 还想只接受数字呢:
enter_count.setInputType( InputType.TYPE_NULL );
如此就会啥都不接受 最好的办法就是
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' };
}
});
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |