【问题标题】:React Native on android - focus from one TextInput to another TextInput needs 2 tapsReact Native on android - 从一个 TextInput 到另一个 TextInput 的焦点需要 2 次点击
【发布时间】:2016-04-13 20:09:20
【问题描述】:

这真的很烦人,当我在一个 TextInput 中编写文本时,然后我点击另一个 TextInput 以获得键盘准备好的焦点,它只会隐藏键盘。如何克服这种行为?我只想点击 TextInput 并立即准备好键盘。

感谢您的建议!

【问题讨论】:

    标签: android react-native


    【解决方案1】:

    你的 TextInputs 在 ScrollView 中吗?

    你需要给你加keyboardShouldPersistTaps={true}ScrollView

    keyboardShouldPersistTaps bool:

    当为 false 时,当键盘向上时在焦点文本输入之外点击会关闭键盘。当为真时,滚动视图将 不捕捉水龙头,键盘不会自动关闭。这 默认值为 false。

    Can't tap from one TextInput to another

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-09
      • 1970-01-01
      • 2018-08-08
      • 2020-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-12
      相关资源
      最近更新 更多