Android : 捕获 return 键 TextInput 反应本机

Android : Capture return key TextInput react native

我试过使用 onKeyPress 但它似乎不起作用。如何从键盘上捕获 return 键?

<TextInput
    placeholder="Type.."
    style={styles.inputStyle}
    onKeyPress={this.onKeyPress}
    value={this.state.text}
 />  

你应该使用 onSubmitEditing 属性并提供一个回调函数。