简体   繁体   English

Android上的软键盘

[英]soft keyboard on Android

There are 4 different activities in application. 应用中有4种不同的活动。 While passing in activities, soft keyboard opens automatically. 传递活动时,软键盘会自动打开。 To fix this I used 为了解决这个问题,我用了

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

but this time when I open keyboard for editText, keyboard cast over the layout that I use at the bottom of the activity. 但是这一次,当我打开editText的键盘时,键盘覆盖了我在活动底部使用的布局。 Is there a way to solve this problem ? 有办法解决这个问题吗?

In your manifest file add android:windowSoftInputMode="stateHidden" 在清单文件中添加android:windowSoftInputMode="stateHidden"

<activity android:name=".YourActivity"
         android:windowSoftInputMode="stateHidden|adjustResize">

Check the developer doc for more details 查看开发者文档以获取更多详细信息

Try this, 尝试这个,

Add this code in your manifestfile.xml .all Activity 将此代码添加到manifestfile.xml .all Activity

 android:windowSoftInputMode="stateHidden|adjustResize" 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM