React native 使react本机文本输入为只读

React native 使react本机文本输入为只读,react-native,React Native,我想在我的RN应用程序中使文本输入为只读。我试图设置可编辑道具,但它没有正常工作。我怎样才能做到这一点 <DetailInput inputStyle={styles.inputStyles} height={120} width={width - 40} multiline={true} numberOfLines={6} underlineColorAndroid="transparent" maxLength={500} editable={!use

我想在我的RN应用程序中使文本输入为只读。我试图设置可编辑道具,但它没有正常工作。我怎样才能做到这一点

<DetailInput
  inputStyle={styles.inputStyles} 
  height={120}
  width={width - 40}
  multiline={true}
  numberOfLines={6}
  underlineColorAndroid="transparent"
  maxLength={500}
  editable={!userRegistrationInProgress}
  onChangeText={value => this.statementChangedHandler(value)}
/>

const detailInput = props => {

    return (
      <TextInput
        {...props}
        style=
          {[
            props.inputStyle,
            { height: props.height, width: props.width},
            !props.valid && props.touched ? props.invalidInput : null
          ]}
      />
    );
}

export default detailInput;
this.statementChangedHandler(值)}
/>
const detailInput=props=>{
返回(
);
}
导出默认输入;


将editable false设置为只读文本输入。

更好的
只读文本输入:



editable={false}适用于TextInput。您能否提供更多信息,了解可能存在的问题。也安慰你的朋友!UserRegistration将继续查看其值并确保其为布尔值。
 <TextInput
    value = "Read Only"
    editable = {false}
 />