android - 如何解决出现数字键盘时编辑文本隐藏的问题?

标签 android android-edittext

我正在制作一个仅在横向模式下用于平板电脑的应用程序。在我的一个屏幕中,我使用带有编辑文本的自定义对话框,当用户输入编辑文本时,数字键盘会覆盖所有编辑文本,因此用户无法看到他/她在编辑文本中输入的内容。我已经使用了 imeOptions 但没有成功。请提出任何其他解决方案。

最佳答案

在AndroidManifest.xml中使用“调整调整大小”

<activity
    ...
    android:windowSoftInputMode="adjustResize" />

来自文档:

"adjustResize" The activity's main window is always resized to make room for the soft keyboard on screen.

"adjustPan" The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

关于android - 如何解决出现数字键盘时编辑文本隐藏的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29818545/

相关文章:

java.lang.NoClassDefFoundError : Failed resolution of: Ljavax/naming/directory/InitialDirContext; 错误

android - 使用 Http Post 发送图像

java - 如何在 Activity 顶部显示 "window/subactivity/dialog"但将焦点保持在 Activity 中

java - Unity3D 与 Eclipse for Android 项目集成

android - 升级到 Android Studio 2.0 后 Gradle 构建过程中出现大量错误

末尾带有不可编辑字符串的Android edittext

java - 如何修复 EditText 的 getText 方法的重写

android - 显示一个 editText

java - 将秒值转换为小时分钟秒?

java - 当edittext不为空时如何自动按回车键?