Unfocus a TextInput in React Native

后端 未结 6 1545
我寻月下人不归
我寻月下人不归 2020-12-29 20:44

I\'m building an Android app with React Native.

How can you force a TextInput to \"unFocus\", meaning the cursor is blinking inside the text field. The

6条回答
  •  醉梦人生
    2020-12-29 21:16

    Found it actually.It doesn't look as pretty and my intuition says this isn't a very "react" solution but if you want it here it is.

     this.refs['email_input'].blur()} 
     placeholder="Email address" 
     placeholderTextColor="white"
     onChangeText={(email) => this.setState({email})}/>
    

提交回复
热议问题