Show keyboard programmatically using React native

前端 未结 3 635
甜味超标
甜味超标 2020-12-20 15:00

How do I show Keyboard for TextInput programmatically using react native? Using a ScrollView, tapping between TextInput causes the keyboard to be dismissed. I want to show t

3条回答
  •  -上瘾入骨i
    2020-12-20 15:52

    consider have a reference of your textInput :

    {this.myTextInput = ref}} />
    

    And when you have to focus it again use : this.myTextInput.focus()

    edit React16

    For react16 use React.createRef to create a reference.

提交回复
热议问题