我的代码如下
componentWillMount() {
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
}
componentWillUnmount() {
this.keyboardDidHideListener.remove();
}
_keyboardDidHide() {
Keyboard.dismiss();
}
<TextInput
placeholder="text 1"
onChangeText={(text) => { this.setState({ text1:text }) }}
underlineColorAndroid='transparent'
value={this.state.text1} />
它在android中工作正常,但在IOS中会出现问题。我的TextInput不会专注于第一次轻按。突然键盘关闭,我的输入失去了焦点。请帮我。任何帮助将不胜感激。