Dam*_*uan 7 android react-native
如何在React Native中清除TextInput焦点?(机器人)
我在这里寻找一个API:
https://facebook.github.io/react-native/docs/textinput.html#content
但没有结果......
有人可以帮忙吗?
Gin*_*ndi 11
我认为这应该有效.将onFocus作为道具添加到您的TextInput.这假设您有一个名为text的状态变量,并TextInput从该状态变量获取其值.
<TextInput
...
onFocus= {() => this.setState({text : ''})}
value={this.state.text}/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5944 次 |
| 最近记录: |