as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
Keyboard module to control keyboard events.

Usage

The Keyboard module allows you to listen for native events and react to them, as well as make changes to the keyboard, like dismissing it.

Reference

Methods

addListener()

The addListener function connects a JavaScript function to an identified native keyboard notification event. This function then returns the reference to the listener. Parameters: eventName This can be any of the following:
  • keyboardWillShow
  • keyboardDidShow
  • keyboardWillHide
  • keyboardDidHide
  • keyboardWillChangeFrame
  • keyboardDidChangeFrame

removeListener()

Parameters:

dismiss()

Dismisses the active keyboard and removes focus.

scheduleLayoutAnimation

Useful for syncing TextInput (or other keyboard accessory view) size or position changes with keyboard movements. It is a wrapper over LayoutAnimation.configureNext(), that automatically animates views to their new positions when the next layout happens.

isVisible()

Whether the keyboard is last known to be visible.

metrics()

Return the metrics of the soft-keyboard if visible.
最后修改于 2026年10月26日