首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >这些属性与android不兼容: autoCorrect和secureTextEntry。

这些属性与android不兼容: autoCorrect和secureTextEntry。
EN

Stack Overflow用户
提问于 2016-04-10 02:10:19
回答 2查看 2.3K关注 0票数 2

TextInput的这两个属性与android不兼容:

  • autoCorrect
  • secureTextEntry

当我拥有autoCorrect时,我遇到了以下错误:

更新由:autoCorrect管理的视图的属性“AndroidTextInput”时出错

当我拥有secureTextEntry时,我遇到了以下错误:

更新由: AndroidTextInput管理的视图的属性“密码”时出错

有人知道怎么处理这事吗?

这是我的代码:

代码语言:javascript
复制
<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>
EN

回答 2

Stack Overflow用户

发布于 2020-09-30 16:30:25

您应该使用autoCorrect={false}

票数 3
EN

Stack Overflow用户

发布于 2016-04-10 18:12:46

这是你的问题。

autoCorrect="false"将在iOS上工作,而不是安卓。

对于安卓来说,它必须是autoCorrect={"false"}

我发现反应-原生iOS原谅一些“坏习惯语法”,安卓不是。

对于这两种情况,都应该使用autoCorrect={'false'}。总是在{}中放置道具

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36524960

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档