显示隐藏的键盘是行不通的属性格式在安卓的PhoneGap [英] Show hide keyboard is not working propery in android phonegap

查看:125
本文介绍了显示隐藏的键盘是行不通的属性格式在安卓的PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我请点击此链接使用[西蒙·麦克唐纳认定中]使用键盘事件[1]在这种情况下我显示我的页脚时键盘隐藏和掩饰自己的页脚时,键盘show.when点击 dictonary 我时,键盘的显示,但该事件进入到键盘的隐藏功能(所以我的页脚如图)..我不知道为什么。

i follow this link to use the keyboard event by using [Simon mac donald Defination][1] In that event i show my footer when keyboard hide and hide my footer when keyboard is show.when click the dictonary my keybord is show but the event is goes to keyboard hide function(so my footer is shown) ..i dont know why..

我重视我的code和设计.Kindly解决这个问题

i attached my code and design .Kindly solve this issue

   <script type="text/javascript">
    $(document).ready(function () 
    {
        document.addEventListener("hidekeyboard", onHide, false);
        document.addEventListener("showkeyboard", onShow, false);

    });
    function onHide() 
    {
        $("#footer").show();
    }

    function onShow() 
    {
        $("#footer").hide();
    }
    </script>
<style type="text/css">

#footer {
    position:absolute;
    bottom:0; left:0;
    width:100%;
    height:7%;
    background-color:#00458D;
    padding:0;
    border-width:3px;
    padding-top:3%;
    padding-bottom:2%;
    padding-right:0px;
    padding-left:0px;
    background-color:#00458D;
}

#content {
    position:absolute; bottom:0;
    top:0;
    width:100%;
    overflow:auto;
}
</style>
  </head>
 <body >
    <div id="content">

        <input type="text" style="width=70%">
            <br/>
            <br/>

        <div id="footer" align="center">
            <table width=100%>
                <input type="image" src="../images/Home.PNG" style="width:23%" onClick="home()"/>
                <input type="image" src="../images/messages-menu.jpg" style="width:23%" onClick="inbox()"/>
                <input type="image" src="../images/settings-menu.jpg" style="width:23%" onClick="settings()"/>
                <input type="image" src="../images/close-menu.png" style="width:23%" onClick="callServiceFunction()"/>
            </table>
        </div>
    </div>
  </body>
</html>

图片

推荐答案

删除。就绪()功能和deviceready添加监听器

Remove the .ready() function and add the listeners in the deviceready

<style type="text/css">

#footer {
    position:absolute;
    bottom:0; left:0;
    width:100%;
    height:7%;
    background-color:#00458D;
    padding:0;
    border-width:3px;
    padding-top:3%;
    padding-bottom:2%;
    padding-right:0px;
    padding-left:0px;
    background-color:#00458D;
}

#content {
    position:absolute; bottom:0;
    top:0;
    width:100%;
    overflow:auto;
}
</style>
<script type="text/javascript">
document.addEventListener("deviceready",onDeviceReady,false);

    function onDeviceReady () {
        document.addEventListener("hidekeyboard", onHide, false);
        document.addEventListener("showkeyboard", onShow, false);

    }
    function onHide() 
    {
        $("#footer").show();
    }

    function onShow() 
    {
        $("#footer").hide();
    }
    </script>

  </head>
 <body >
    <div id="content">

        <input type="text" style="width=70%">
            <br/>
            <br/>

        <div id="footer" align="center">
            <table width=100%>
                <input type="image" src="../images/Home.PNG" style="width:23%" onClick="home()"/>
                <input type="image" src="../images/messages-menu.jpg" style="width:23%" onClick="inbox()"/>
                <input type="image" src="../images/settings-menu.jpg" style="width:23%" onClick="settings()"/>
                <input type="image" src="../images/close-menu.png" style="width:23%" onClick="callServiceFunction()"/>
            </table>
        </div>
    </div>
  </body>
</html>

这篇关于显示隐藏的键盘是行不通的属性格式在安卓的PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆