android-layout - 如何防止软键盘调整背景图像的大小

标签 android-layout

我有一个典型的listviewedittext以及事件底部的按钮。

当我点击 edittext , 软键盘出现,我可以滚动 listview 中的项目但它重新调整了我的背景图像的大小。

我试过 android:windowSoftInputMode="adjustResize"但没有区别。

我试过 android:windowSoftInputMode="adjustPan" .图像没有被压扁,整个布局向上移动,我失去了标题栏。如果列表项超过布局大小,我只能滚动列表。

基本上,我想保留标题栏,保留背景图像而不调整大小并允许滚动列表项。有没有人设法做到这一点?谢谢!

最佳答案

对于 ListView ,您需要使用

android:isScrollContainer="false"

并将其添加到 manifest.xml 中的事件中
android:windowSoftInputMode="adjustPan"

关于android-layout - 如何防止软键盘调整背景图像的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5307264/

相关文章:

android - 布局宽度和布局高度

android - bottone1 无法解析或不是字段

android - 在 Android 上将 TextView 放在另一个 TextView 旁边以获得更长的文本

android - TextView 将布局参数设置为 fill_parent 时垂直写入文本

android - 为什么 XML 元素在我的 android studio 模拟器上不可见?

android - 单击深层链接 url 打开带有红色边框的应用程序

android-layout - Android SDK 中的常量

android - 如何防止警报对话框被后退按钮关闭

android - 在 LinearLayout 中自动调整 ImageButtons 的大小

Android ListView 斜体