我希望能够点击键盘上的输入按钮,继续关注TextInput
,并保持键盘打开。如何才能做到这一点?
关于qazxsw poi实现的答案是指触摸qazxsw poi外部的按钮而不是实际敲击键盘上的返回键。
在ScrollView
上执行此操作的方法是设置TextInput
,然后使用TextInput
作为提交处理程序而不是blurOnSubmit={false}
。
onSubmitEditing
按下返回键onEndEditing
清除 onTextChange(input) {
this.setState({ value: input })
}
submitValue() {
// Do things with the value
...
// Then reset it so the TextInput can be reused
this.setState({ value: '' })
}
<TextInput
blurOnSubmit={false}
style={styles.inputBox}
onChangeText={input => this.onTextChange(input)}
onSubmitEditing={() => this.submitValue(this.state.value)}
value={this.state.value}
/>
的文本。