【问题标题】:Error on an Android Studio project while updating property:更新属性时 Android Studio 项目出错:
【发布时间】:2020-07-26 06:59:20
【问题描述】:

当我使用 React Native 时,我使用的是 iOS,但是当我迁移到 Andriod 时,我遇到了一个在 iOS 中从未出现过的错误。那是:

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

java.lang.String 不能转换为 java.lang.Boolean。

构建中没有错误,所以这是代码的问题。 (我附上 Android Studio 和模拟器的截图以防万一)

谢谢。

(几乎我所有的代码中都有TextInputs,但在错误中,它被称为AndroidTextInput,即使在我的代码中我使用TextInput)

【问题讨论】:

    标签: javascript react-native android-studio


    【解决方案1】:

    您需要将 secureTextEntry 作为布尔值而不是字符串传递:

    <TextInput secureTextInput={true} />

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-23
      • 1970-01-01
      • 1970-01-01
      • 2017-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多