当我在我的应用程序中键入我的密码时,它会显示数字而不会散列它们。 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>
);
答案 0 :(得分:1)
如果您使用image.crop((50, 60, 100, 120)).save("test.jpg")
image_arr = np.array(Image.open("test.jpg")) / 255
mean = np.array([0.485, 0.456, 0.406])
std_dv = np.array( [0.229, 0.224, 0.225])
image_arr = (image_arr - mean)/std_dv
print(image_arr)
#Output:
[[[-0.04580872 0.08263305 0.30448802]
[-0.91917116 -0.81022409 -0.58440087]
[ 0.81042898 0.95798319 1.17594771]
...
[ 2.19753404 2.37605042 2.58771242]
[-0.02868396 -0.19747899 0.13019608]
[-0.11430773 -0.28501401 0.04305011]]
....etc.
,它将不起作用
删除keyboardType,它将正常工作
答案 1 :(得分:1)
secureTextEntry-如果为true,则文本输入将隐藏输入的文本,以使敏感文本(如密码)保持安全。默认值为false。不适用于multiline = {true}。