android edittext不弹出软键盘
方法一:
在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 P] Android P版本 新功能介绍和兼容性处理(一)
- [Android Pro] android控件ListView顶部或者底部也显示分割线
- [Android Pro] 横竖屏切换时,禁止activity重新创建,android:configChanges="keyboardHidden|orientation" 不起作用
- [Android Traffic] android 流量计算方法
- Failed to fetch URl https://dl-ssl.google.com/android/repository/addo Android SDK更新以及ADT更新出现问题的解决办法
- android守护进程
- Android 开发之旅:短信的收发及在android模拟器之间实践(一)
- Android API之android.content.AsyncQueryHandler
- Android 应用开发实例之情景模式
- 1、Android Studio集成极光推送(Jpush) 报错 java.lang.UnsatisfiedLinkError: cn.jpush.android.service.PushProtoco
- android edittext不弹出软键盘
- Android Matrix类以及ColorMatri
- 114、Android禁止ViewPager的左右滑动
- 【VLC-Android】Mac下编译vlc-android
- Android EditText 常见问题总结
- Android的报错提示:Failed to resolve: com.android.support.test.espresso:espresso-core:3.0.2
- android 11.0 SystemUI禁用锁屏功能
- android jni用mmap接口实现文件读写功能
- Android EditText编辑框随输入法移动并且在输入法上面
- Android EditText密码框的显示和隐藏
- Android的java的报错提示:Could not find com.android.tools.build:gradle:4.2.2.
- 在Android Studio上导入github的项目后报错提示:Unknown host ‘repo.maven.apache.org‘
- Android中使用EditText时设定inputType的说明
- Android开发问题集锦(七)--HttpURLConnection大文件传输
- Android添加gdb symbols
- android -- 蓝牙 bluetooth (四)OPP文件传输