gpt4 book ai didi

javascript - 更新属性 : 时 Android Studio 项目出错

转载 作者:行者123 更新时间:2023-12-01 17:17:41 24 4
gpt4 key购买 nike

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

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

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

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

enter image description here

enter image description here

谢谢。

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

最佳答案

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

<TextInput secureTextInput={true} />

关于javascript - 更新属性 : 时 Android Studio 项目出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61192618/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com