How to use Phonegap SoftKeyboard Plugin for Android?

前端 未结 5 1523
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 00:31

I am developing an Android application using Phonegap. I need to make the softkeyboard appear programatically. I am using the SoftKeyboard plugin which is found here. Can an

5条回答
  •  心在旅途
    2020-12-05 01:09

    For the latest version of PhoneGap (Apache Cordova 2.1.0) I had to do the following:

    Installed these plugin sources which reflected the project name change: https://github.com/originalgremlin/phonegap-plugins/tree/master/Android/SoftKeyboard

    • Copy softkeyboard.js to your javascript library directory.
    • Copy SoftKeyBoard.java to src/org/apache/cordova/plugins/SoftKeyBoard.java

    Put this in your HTML file, after including the cordova.js file:

    
    

    Add this to the bottom of the res/xml/config.xml plugins section:

    
    

    Now, assuming this HTML:

    
    

    This jQuery should do something useful:

    var softkeyboard = window.cordova.plugins.SoftKeyBoard;
    $('#keyboard').toggle(softkeyboard.show, softkeyboard.hide);
    

提交回复
热议问题