React Native 为什么每次我点击 textInput 时我的键盘都会立即消失?

Pan*_*ang 9 textinput dismiss react-native

当我点击文本输入时,我的键盘总是立即消失。这只发生在 Android 上。

奇怪的是,我尝试仅将所有不相关的代码删除到textInput,但问题仍然存在。这仅发生在我的应用程序的一页上。

  <View>
            <TextInput
              style={{
                paddingVertical: 0,
                textAlignVertical: 'center',
                height: height * 0.05,
                width: width * 0.4,
                fontSize: height * 0.027,
                color: '#E1E1F2',
                borderBottomWidth: 1,
                borderBottomColor: '#6B778A',
                justifyContent: 'center',
              }}
              placeholderTextColor={'#6B778A'}
              underlineColorAndroid='black'/>
  </View>
Run Code Online (Sandbox Code Playgroud)

我认为代码没有问题,我真的需要帮助。

屏幕记录:media.giphy.com/media/Vc6AbKbMsnZX8ykKqR/giphy.gif

Mar*_*ček 1

您的输入可能位于 ScrollView 内。

请参阅React Native:在 ScrollView 中更改焦点时键盘关闭以获取解决方案。