PhoneGap: Is there a way to stop the keyboard from resizing the view?(PhoneGap:有没有办法阻止键盘调整视图大小?)
问题描述
我目前正在将 PhoneGap 用于我正在开发的移动应用程序.在我的登录屏幕中,当我选择一个文本字段时,当键盘向上滑动时,视图会水平缩小.这只发生在 Android 而不是 iOS.
I'm currently using PhoneGap for a mobile app I'm developing. In my Login screen, when I select a text field, the view shrinks horizontally when then keyboard slides up. This only happens on the Android and not iOS.
这让我很担心,因为我有一个底部工具栏 position:absolute;bottom:0; 当键盘出现时,这个工具栏会在 Android 中向上推.在 iOS 中,键盘只是简单地覆盖它.
This concerns me because I have a bottom toolbar that is position:absolute; bottom:0; and this toolbar is pushed up in Android when the keyboard shows up. In iOS, the keyboard just simply overlays it.
推荐答案
在 AndroidManifest.xml 在你的主要活动上添加以下内容:
In AndroidManifest.xml on your main activity add the following:
android:windowSoftInputMode="adjustPan"
和
android:configChanges="orientation|keyboardHidden"
在 index.html 中添加创伤指出的内容:
In index.html add what traumalles pointed out:
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" />
这篇关于PhoneGap:有没有办法阻止键盘调整视图大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PhoneGap:有没有办法阻止键盘调整视图大小?
基础教程推荐
- 我的 UIImageView 的任务 2022-01-01
- 在 iOS8 中无法获得正确的键盘高度值 2022-01-01
- 突出显示朗读文本(在 iPhone 的故事书类型应用程序中) 2022-01-01
- 可可/目标C(OSX不是iOS)从子对象访问父对象 2022-01-01
- - (CGRect)convertRect:(CGRect)rect toView:(UIView *)view 如何工作 2022-01-01
- 如何将多个组件添加到 PickerView? 2022-01-01
- Android:STATE_SELECTED不工作 2022-01-01
- 在 appComponent dagger 2 中动态添加测试模块? 2022-01-01
- 在 Android 模拟器中激活网络位置提供程序? 2022-01-01
- 新的@SystemApi 注解是什么意思,和@hide 有什么区别 2022-01-01
