如何正确配置Android的phonegap,所以它不放大文本输入 [英] How to properly configure phonegap for Android so it does not zoom on text input
问题描述
早上好,
我正在建立一个Android应用程式,对于我的生活我不能停止从动物园的HTC和ZTE设备在荒谬的关闭,当你使用文本域。
I am building an Android app and for the life of me I cannot stop HTC and ZTE devices from zoooming in ridiculously close when you use a text field.
我试图以高分辨率构建这个视口,这是我的元视口设置。
I am trying to build this in a high resolution, and this is my meta viewport settings.
<meta name="viewport" content="width=device-width,target-densitydpi=320, initial-scale=1.0 minimum-scale=1.0, maximum-scale=1.0">
这在几乎每个设备上都很好用,但在测试ZTE warp使用2.3.5,它放大输入字段。
This works great on almost every single device, but on a test ZTE warp using 2.3.5 , it zooms into input fields.
请帮助!
推荐答案
PhoneGap / Cordova应用 - 在浏览器中,忽略了很多这些元属性,具体取决于发布的版本。
PhoneGap/Cordova apps use the built-in browser which ignores a lot of these meta-attributes, depending on the shipped version.
Phonegap最近添加了对Androids的支持windowSoftInputMode,它控制软键盘的行为。
Phonegap recently added support for Androids windowSoftInputMode, which controls the behaviour of the soft keyboard.
设置<$在config.xml中的c $ c>< preference name =android-windowSoftInputModevalue =adjustPan/> 禁用缩放并改用平移。
Setting <preference name="android-windowSoftInputMode" value="adjustPan" />
in your config.xml disables zooming and uses panning instead.
有关所有可能值的完整列表,请参阅Android API文档: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
For a comprehensive list of all possible values, see the Android API Documentation: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
这篇关于如何正确配置Android的phonegap,所以它不放大文本输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!