android edittext不弹出软键盘
2011-09-20 09:18
411 查看
方法一:
在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);
相关文章推荐
- Android Edittext获取焦点后,弹出的软键盘显示搜索、发送、完成等功能
- Android中使EditText失去焦点禁止弹出键盘
- android EditText 设置弹出数字输入法键盘
- Android--点击EditText的时候弹出软键盘,点击EditText之外空白处软键盘消失
- android edittext不弹出软键盘
- Android中使EditText失去焦点,edittext禁止弹出键盘[转]
- Android 获取EditText焦点后自动弹出软键盘
- Android避免进入一页面后EditText自动弹出软键盘
- Android避免进入页面EditText自动弹出软键盘
- android EditText 设置弹出数字输入法键盘
- AndroidのEditText失去焦点,edittext禁止弹出键盘
- Android禁止输入框控件EditText弹出软键盘
- 关于android中EditText自动获取焦点并弹出键盘的相关设置
- Android开发之将Edittext输入弹出的软键盘设置搜索确定键。详细代码,已验证可用。
- android开发中防止刚进入activity时edittext获取焦点,防止自动自动弹出软键盘
- Android中使EditText失去焦点,edittext禁止弹出键盘
- android edittext不弹出软键盘
- Android EditText获取焦点并弹出软键盘
- Android 点击EditText的时候弹出软键盘,点击EditText之外空白处软键盘消失
- android edittext 键盘弹出屏幕自适应