npm i --save @bezlepkin/nativescript-keyboard-opening
- 版本:1.0.1
- GitHub: https://github.com/Bezlepkin/nativescript-plugins
- NPM: https://npmjs.net.cn/package/%40bezlepkin%2Fnativescript-keyboard-opening
- 下载量
- 昨天: 2
- 上周: 4
- 上个月: 14
@bezlepkin/nativescript-keyboard-opening
一个插件,允许您跟踪键盘打开、变化、关闭并返回键盘高度。
npm install @bezlepkin/nativescript-keyboard-opening
用法
import { keyboardOpening } from '@bezlepkin/nativescript-keyboard-opening';
keyboardOpening().on('opened', async (args: any) => {
console.log('The keyboard is opened', args.data.height);
});
keyboardOpening().on('changed', async (args: any) => {
console.log('The keyboard is changed', args.data.height);
});
keyboardOpening().on('closed', async (args: any) => {
console.log('The keyboard is closed');
});
当您切换到另一个屏幕时停止跟踪,您需要取消订阅操作
keyboardOpening().off('opened');
keyboardOpening().off('changed');
keyboardOpening().off('closed');
许可证
Apache License 版本 2.0