android - Dialog 的 setSoftInputMode 在键入时不隐藏 EditText?

标签 android keyboard dialog android-edittext

我有一个自定义对话框,它在 View 底部有一个 EditText。当我选择 EditText 时,键盘出现但在对话框中隐藏了 EditText。

我知道您可以将 windowSoftInputMode 用于 Activity ,引用资料说您可以使用 Window.setSoftInputMode() 对于非 Activity ..但是如何做到这一点???

Reference

我试过这样做 Getting Keyboard To Appear Without Having To Click on EditText

但是之后

Dialog.show();

我放了

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

但是没有任何效果.. 帮忙谢谢

最佳答案

试试这个:

dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

关于android - Dialog 的 setSoftInputMode 在键入时不隐藏 EditText?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6766495/

相关文章:

android - 使用矢量图像扩展应用程序平台

android - 如何通过在android屏幕上触摸关闭抽屉导航

javascript - 如何隐藏专注于 Android 的文本区域?

android - 通过异步任务更新 TextView

javascript - jQuery UI 对话框 : Close when Click Outside

Android ListView 与 CardView : Last Card not fully displayed when scrolling

c# - 使用 C# 的半非托管代码

swift - 在 tvOS 上打开键盘而不单击 TextField - Swift

python - 使用 python 在 Mac 上监视全局键盘输入

java - 尝试访问自定义 AlertDialog 的子级会导致 NullPointerException