Keyboard
Repo: https://github.com/ionic-team/ionic-plugin-keyboard
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add ionic-plugin-keyboard $ npm install --save @ionic-native/keyboard
- Add this plugin to your app's module
Supported platforms
- Android
- BlackBerry 10
- iOS
- Windows
Usage
import { Keyboard } from '@ionic-native/keyboard';
constructor(private keyboard: Keyboard) { }
...
this.keyboard.show();
this.keyboard.close();
Instance Members
hideKeyboardAccessoryBar(hide)
Hide the keyboard accessory bar with the next, previous and done buttons.
Param | Type | Details |
---|---|---|
hide |
boolean
|
show()
Platforms:Android BlackBerry 10 Windows
Force keyboard to be shown.
close()
Platforms:iOS Android BlackBerry 10 Windows
Close the keyboard if open.
disableScroll(disable)
Platforms:iOS Windows
Prevents the native UIScrollView from moving when an input is focused.
Param | Type | Details |
---|---|---|
disable |
boolean
|
onKeyboardShow()
Platforms:iOS Android BlackBerry 10 Windows
Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
Returns: Observable<any>
onKeyboardHide()
Platforms:iOS Android BlackBerry 10 Windows
Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
Returns: Observable<any>