React Native 和键盘:如何在不使用 TextInput 的情况下在 useEffect 中切换键盘?

React Native & Keyboard : How do I toggle the keyboard in useEffect without using TextInput?

我正在使用功能组件编写 React Native。

我想在不使用 TextInput 的情况下切换和呈现键盘值。

useEffect(() => {
    // Keyboard.addListener('handleKeyPress', handleKeyPress)
  }, []);

我该怎么做?请给我一个示例代码。

您可以将TextInput的样式与背景搭配起来!