只要一点击,光标就跑到前面去,不能想系统键盘哪一,移动哪里,就到哪里
解决方法一: 推荐
private EditText etLicense;
if (android.os.Build.VERSION.SDK_INT <= 10) {
etLicense.setInputType(InputType.TYPE_NULL);
} else {
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
try {
Class<EditText> cls = EditText.class;
Method setShowSoftInputOnFocus;
setShowSoftInputOnFocus = cls.getMethod(
"setShowSoftInputOnFocus", boolean.class);
setShowSoftInputOnFocus.setAccessible(true);
setShowSoftInputOnFocus.invoke(etLicense, false);
} catch (Exception e) {
e.printStackTrace();
}
}
}