博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android edittext不弹出软键盘
阅读量:6950 次
发布时间:2019-06-27

本文共 876 字,大约阅读时间需要 2 分钟。

 

方法一: 
在AndroidMainfest.xml中选择哪个activity,设置windowSoftInputMode属性为adjustUnspecified|stateHidden 
例如:<activity android:name=".Main" 
                  android:label="@string/app_name" 
                  android:windowSoftInputMode="adjustUnspecified|stateHidden" 
                  android:configChanges="orientation|keyboardHidden"> 
            <intent-filter> 
                <action android:name="android.intent.action.MAIN" /> 
                <category android:name="android.intent.category.LAUNCHER" /> 
            </intent-filter> 
        </activity> 
方法二: 
让EditText失去焦点,使用EditText的clearFocus方法 
例如:EditText edit=(EditText)findViewById(R.id.edit); 
           edit.clearFocus(); 
方法三: 
强制隐藏Android输入法窗口 
例如:EditText edit=(EditText)findViewById(R.id.edit);  
           InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
           imm.hideSoftInputFromWindow(edit.getWindowToken(),0); 
2.EditText始终不弹出软件键盘 
例:EditText edit=(EditText)findViewById(R.id.edit); 
       edit.setInputType(InputType.TYPE_NULL); 

转载地址:http://rskil.baihongyu.com/

你可能感兴趣的文章
正则表达式匹配a标签或div标签
查看>>
《跃迁-成为高手的技术》感悟
查看>>
ANSI设备驱动器
查看>>
面试-2
查看>>
Odoo 10的Linux安装
查看>>
常用概念比较
查看>>
各分支Linux的镜像下载地址
查看>>
读取XML的内容
查看>>
Devil fly
查看>>
结合项目实例 回顾传统设计模式(三)装饰者模式
查看>>
常用性能分析工具
查看>>
JZOJ 1003【东莞市选2007】拦截导弹——dp
查看>>
bzoj 2093 [Poi2010]Frog——滑动窗口
查看>>
Linux的一些基本命令
查看>>
学习笔记——WPF
查看>>
quartus 对比引脚兼容
查看>>
C# Listview 第一列不能居中
查看>>
I.MX6 uSDHC SD card register
查看>>
再转一篇gtest1.6安装
查看>>
丰田栽了的原因,嵌入式软件工程师都该看看
查看>>