禁止Edittext弹出软件盘,光标依然正常显示
2016-05-30 22:11
295 查看
/** * 禁止Edittext弹出软件盘,光标依然正常显示。 */ public void disableShowSoftInput() { if (android.os.Build.VERSION.SDK_INT <= 10) { editText.setInputType(InputType.TYPE_NULL); } else { Class<EditText> cls = EditText.class; Method method; try { method = cls.getMethod("setShowSoftInputOnFocus",boolean.class); method.setAccessible(true); method.invoke(editText, false); }catch (Exception e) { // TODO: handle exception } try { method = cls.getMethod("setSoftInputShownOnFocus",boolean.class); method.setAccessible(true); method.invoke(editText, false); }catch (Exception e) { // TODO: handle exception } } }
相关文章推荐
- Centos 6.5 Zabbix HA
- 线程与进程
- 开源新闻速递:新版 KDE 分区管理器支持管理 LUKS 分区
- 开源新闻速递:新版 KDE 分区管理器支持管理 LUKS 分区
- PHP入门
- mysql 的密码重置
- bash if 表达式
- Java中如何判断当前环境是大端字节顺序还是小端字节顺序
- 手机开发实战49——手机输入法介绍2
- codevs p1082线段树 区间修改
- 第三章 C语言运算符与表达式
- 小酌重构系列[21]——避免双重否定
- 小酌重构系列[21]——避免双重否定
- Android studio 发布Android Library项目到JCenter
- Problem-S
- 手机开发实战48——手机输入法介绍1
- iOS 多线程篇9—NSOperation简单介绍
- Centos 7 安装 KVM
- 在homestead php7的ubuntu环境中安装 php redis扩展的方法
- 算价格01