android - react-native,这些属性与android不兼容: autoCorrect and secureTextEntry

标签 android react-native

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

  • 自动更正
  • secureTextEntry

当我有自动更正功能时,我遇到了以下错误:

Error while updating property 'autoCorrect' of a view managed by: AndroidTextInput

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

Error while updating property 'password' of a view managed by: AndroidTextInput

有谁知道如何处理这个问题吗?

这是我的代码:

<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>

最佳答案

您应该使用 autoCorrect={false}

关于android - react-native,这些属性与android不兼容: autoCorrect and secureTextEntry,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36524960/

相关文章:

android - ConstraintLayout - 避免重叠

安卓包结构

javascript - 如何在 React-Native 中将按下事件从内部 Touchable 冒泡到外部 Touchable?

android - 使用 android WorkManager 响应 Native HeadlessJs 任务调用

android - 如何隐藏所有的 ExoPlayer2?

c# - MVVM 模式中的 Viewpager

android - 如何在 React-native 中使用视频文件路径将视频存储在 firebase 存储中

ios - 如何在 iOS 上禁用 firestore 的持久性(缓存)

react-native - React Native - 嵌套导航器时 react 导航缓慢转换

在 BillingClient.launchBillingFlow 期间 Android Play 商店崩溃