In the ionic project, the soft keyboard input method automatically pops up on ios, ionicios

Source: Internet
Author: User

In the ionic project, the soft keyboard input method automatically pops up on ios, ionicios

1. Install the plug-in cordova plugin add ionic-plugin-keyboard

II,

Soft keyboard display listener

Window. addEventListener ('native. keyboardshow ', function (e ){

// Todo operation when the keyboard is available

// E. keyboardHeight indicates the height when the software disk is displayed })

Keypad hidden listener

Window. addEventListener ('native. keyboardhide ', function (e ){

// Todo operations when the keyboard is unavailable });

Enable the keyboard

Cordova. plugins. Keyboard. show ();

Close the keypad

Cordova. plugins. Keyboard. close ();

Determine whether the keypad is available

Cordova. plugins. Keyboard. isVisible

Show/hide the attachment bar of the keypad

Cordova. plugins. Keyboard. hideKeyboardAccessoryBar (true );

Cordova. plugins. Keyboard. hideKeyboardAccessoryBar (false );

Disable and allow slide

cordova.plugins.Keyboard.disableScroll(true);

cordova.plugins.Keyboard.disableScroll(false);

 

View http://blog.csdn.net/sean_css/article/details/70243893

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.