NativeScript NA Keyboard plugin
NOTE! Android is currently not supported.
A NativeScript keyboard observer that utilizes KWKeyboardListener for iOS.
Installation
$ tns plugin add nativescript-na-keyboard
Usage
Simply require the plugin and do as such:
var NAKeyboard = ; NAKeyboard;
Methods
on()
To observe keyboard activity.
on(eventTypes, callback)
- eventTypes - Can be either "open" or "close". If both, separate them with a blankspace (i.e. "open close").
- callback - The callback function. Available parameter is "eventData" which is an object that includes
eventName
andkeyboardFrame
.
setAvoidingView()
Set a view that the keyboard should avoid.
setAvoidingView(view)
- view - The view that should be pulled when the keyboard opens.
var view = page; // The TextField viewNAKeyboard;
Other methods
keyboardVisible()
- Returns true or false depending on keyboard's current state.
Known issues
- No Android compatibility, yet.
History
Version 1.1.0 (22 October 2016)
- Added two new methods:
keyboardVisible()
andsetAvoidingView()
.
Version 1.0.1 (18 October 2016)
- Added to npm.
Version 1.0.0 (18 October 2016)
on()
method for observing keyboard activity.
Credits
- NordlingArt
- kwarter (for providing KWKeyboardListener)
License
MIT - for {N} version 2.0.0+