Skip to content

此页面的翻译正在准备中,暂时显示英文原文。

isKeyboardVisible

isKeyboardVisible is a utility function that checks whether the on-screen keyboard is currently visible. This function uses getKeyboardHeight() internally and returns true if the keyboard height is greater than 0.

Interface

ts
function isKeyboardVisible(): boolean;

Parameters

Return Value

  • boolean

    if the keyboard is visible, false otherwise.

Example

tsx
if (isKeyboardVisible()) {
  console.log('Keyboard is open');
} else {
  console.log('Keyboard is closed');
}

基于 MIT 许可证发布。