键盘隐藏输入(位置:固定;底部:0;)在Android的PhoneGap [英] keyboard hide input (position:fixed; bottom:0;) with phonegap on android
本文介绍了键盘隐藏输入(位置:固定;底部:0;)在Android的PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试了很多东西。
<preference name="fullscreen" value="false" />
<preference name="android-windowSoftInputMode" value="adjustResize" />
这似乎是prefered方法但是我的键盘仍然显示在我的投入上。
This seems to be the prefered methods however my keyboard still show on top of my input.
如果adjustResize强制应用程序窗口的大小?我需要别的东西吗?
Should adjustResize force the app window to resize? do I need something else?
我怎么能阻止它躲在我的元素在位置固定底部?
How can I stop it from hiding my element in position fixed bottom?
感谢
推荐答案
尝试是这样的:
在的$(document)添加这些片code的。就绪(函数(){})。
Add these piece of code in $(document).ready(function() {});
function in your html page where soft keyboard is appearing.
var initialScreenSize = window.innerHeight;
window.addEventListener("resize", function() {
if(window.innerHeight < initialScreenSize){
$("#footer").hide();
document.body.style.position = "fixed";
}
else{
document.body.style.position = "";
$("#footer").show();
}
});
这将可能会帮助你。
这篇关于键盘隐藏输入(位置:固定;底部:0;)在Android的PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文