简体   繁体   中英

How to disable keyboard in Phonegap/Cordova app?

I'm creating a aplication with cordova/phonegap and I need to disable the keyboard even when I'm inside a textbox. I dont want the keyboard appears in any situation. The application has a textbox that occupies most of the window. Below is a zone of buttons that are right for putting text inside the textbox.

If I put the textbox 'readonly' the keyboard dont appear but I need to see where the pointer is currently located.

Mi apllication is for Android.

Thanks very very much!

You can use soft keyboard to hide it. It is available at github all you have to do is put in this code after the plugin soft keyboard has been added:

plugins.SoftKeyBoard.hide(function () {
// success
 },function () {
// fail
});

Or/And you could add or change the meta tag in your head tags of html to:

<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" />

If you don't want to run the keyboard at all during the app just remove the plugin and don't use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM