react native,这些属性与android不兼容:autoCorrect和secureTextEntry
react native,这些属性与android不兼容:autoCorrect和secureTextEntry,android,react-native,Android,React Native,TextInput的这两个属性与android不兼容: 自动更正 secureTextEntry 我在进行自动更正时遇到以下错误: 更新由以下管理的视图的属性“自动更正”时出错:AndroidTextInput 我在使用secureTextEntry时遇到以下错误: 更新由以下管理的视图的属性“密码”时出错:AndroidTextInput 有人知道怎么处理吗 这是我的密码: <Text style={styles.text}>{text.Email}</Text>
TextInput
的这两个属性与android不兼容:
自动更正
secureTextEntry
<Text style={styles.text}>{text.Email}</Text>
<View style={styles.inputRow}>
<Image style={externalStyles.styles.iconImage} resizeMode="contain" source={externalImags.Images.emailIcon} />
<TextInput
style={styles.textInput}
onChangeText={(text) => this.setState({email: text})}
value={this.state.email}
keyboardType="email-address"
placeholder={text.email}
autoCorrect="false"
clearButtonMode="always"/>
</View>
<Text style={styles.text}>{text.Password}</Text>
<View style={styles.inputRow}>
<Image style={externalStyles.styles.iconImage} resizeMode="contain" source={externalImags.Images.passwordIon} />
<TextInput
style={styles.textInput}
onChangeText={(text) => this.setState({password: text})}
value={this.state.password}
keyboardType="default"
placeholder={text.password}
autoCorrect="false"
secureTextEntry="ture"
clearButtonMode="always"/>
</View>
{text.Email}
this.setState({email:text})
值={this.state.email}
keyboardType=“电子邮件地址”
占位符={text.email}
autoCorrect=“false”
clearButtonMode=“始终”/>
{text.Password}
this.setState({password:text})}
值={this.state.password}
keyboardType=“默认值”
占位符={text.password}
autoCorrect=“false”
secureTextEntry=“true”
clearButtonMode=“始终”/>
这是您的问题
autoCorrect=“false”
将在iOS上运行,但不会在Android上运行
对于Android,它需要是autoCorrect={“false”}
我发现React原生iOS可以原谅一些“坏习惯语法”,Android则不然
您应该同时使用
autoCorrect={'false'}
。始终在{}
中放置道具。您应该使用自动更正={false}谢谢!实际上,我需要把它放在{}中,但不带引号,比如:autoCorrect={false}secureTextEntry={true}它解决了这个问题。