如何在React Native中清除TextInput的焦点?(Android)
我在这里查找了一个API:
https://facebook.github.io/react-native/docs/textinput.html#content
但是没有结果...
有人可以帮忙吗?
如何在React Native中清除TextInput的焦点?(Android)
我在这里查找了一个API:
https://facebook.github.io/react-native/docs/textinput.html#content
但是没有结果...
有人可以帮忙吗?
我认为这应该能够工作。将 onFocus 添加为 TextInput
的属性。假设您有一个名为 text 的状态变量,并且 TextInput
取自该状态变量的值。
<TextInput
...
onFocus= {() => this.setState({text : ''})}
value={this.state.text}/>