键盘显示搞砸元素的位置元素、键盘、位置

2023-09-06 14:42:11 作者:小丸子

我的游戏需要移动的触摸式键盘的输入。它的显示器有问题,只要键盘显示了在文本输入焦点,所有的元件,它的位置是:绝对得乱七八糟。

I have game which require the input of touch keyboard of the mobile. Its display has problem, whenever the keyboard shows up at the text input focus, all my element which position: absolute gets all messed up.

有一个插件,使移动键盘总是出现让我重新定位的所有元素或者我需要改变的CSS,使元素,使得不要弄乱时,键盘显示出来?

Is there a plugin that enables mobile keyboard to always show up so that I re-position all the elements OR I need to alter the css to make the elements so that the do not mess up when the keyboard shows up?

我应该如何实现呢?

这是该元素的CSS之一:

This is one of the element css:

#mixer{  
    position: absolute;  
    bottom:29%;
    left:25%;
    width: 234px;  
    height: 210px;  
    background: transparent url(img/mixer.png) 0 50px no-repeat;  
} 

注:我使用jQuery Mobile的,的PhoneGap在Android环境

Note: I am using Jquery mobile, phonegap on Android environment.

推荐答案

在你的Andr​​oidManifest.xml中,用键盘的活动下添加以下行:

In your AndroidManifest.xml, add the following line under the activity with the keyboard:

安卓windowSoftInputMode =adjustNothing