Keyboard
Keyboard plugin for Cordova.
Requires Cordova plugin: cordova-plugin-ionic-keyboard
. For more info, please see the Keyboard plugin docs.
Repo: https://github.com/ionic-team/cordova-plugin-ionic-keyboard
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-ionic-keyboard $ npm install --save @ionic-native/keyboard@4
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { Keyboard } from '@ionic-native/keyboard';
constructor(private keyboard: Keyboard) { }
...
this.keyboard.show();
this.keyboard.hide();
Instance Members
isVisible
Check keyboard status visible or not.
Returns: boolean
hideFormAccessoryBar(hide)
Hide the keyboard accessory bar with the next, previous and done buttons.
Param | Type | Details |
---|---|---|
hide |
boolean
|
hide()
Platforms:iOS Android
Hide the keyboard if shown.
show()
Platforms:Android
Force keyboard to be shown.
setResizeMode(mode)
Platforms:iOS
Programmatically set the resize mode
Param | Type | Details |
---|---|---|
mode |
string
|
onKeyboardShow()
Platforms:iOS Android
Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
Returns: Observable<any>
onKeyboardWillShow()
Platforms:iOS Android
Creates an observable that notifies you when the keyboard will show. Unsubscribe to observable to cancel event watch.
Returns: Observable<any>
onKeyboardHide()
Platforms:iOS Android
Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
Returns: Observable<any>
onKeyboardWillHide()
Platforms:iOS Android
Creates an observable that notifies you when the keyboard will hide. Unsubscribe to observable to cancel event watch.
Returns: Observable<any>