2

当我在我的应用程序中输入我的 pin 密码时,它会显示数字而不对它们进行哈希处理。secureTextEntry 是密码加密的正确属性还是还有其他的?

SetPinScreen.js:

return (
        <View style={{width: 250, height: 170, backgroundColor: Colors.trans, alignItems: 'center'}}>
            <Text style={{fontSize: 20, textAlign: 'center', color: this.props.color}}>{this.props.title}</Text>    
            <TextInput 
                ref={"pinTextField"}
                maxLength={4}
                clearTextOnFocus={true}
                style={{fontFamily: 'Roboto', width: 160, height: 100, borderBottomWidth: this.props.showUnderline === true?1:0, borderBottomColor: this.props.color, fontSize: 60, textAlign: 'center', color: this.props.color}}
                value={this.state.inputCode} 
                clearTextOnFocus={true}
                autoFocus={true}
                secureTextEntry={true}
                keyboardType={"phone-pad"}
                onBlur={this.onKeepKeyboardVisible}
                autoCorrect={false}
                autoCapitalize={"sentences"}
                caretHidden={true}
                underlineColorAndroid='transparent'
                onChangeText={(text) => this.handleTextChange(text)}/>
            <Text style={{fontSize: 16, textAlign: 'center', color: Colors.red}}>{this.state.errorMsg}</Text>   
        </View>
    );
4

2 回答 2

2

如果您使用 keyboardType={"phone-pad"} remove keyboardType 它将无法正常工作,并且可以正常工作

于 2019-01-02T18:59:47.043 回答
1

secureTextEntry - 如果为 true,则文本输入隐藏输入的文本,以便密码等敏感文本保持安全。默认值为假。它不适用于 multiline={true}。

于 2020-04-08T19:45:06.000 回答