快捷搜索:

密码输入框从密文切到明文,后面会出现空格

点击开关进行输入框明密文切换

becomeFirstResponder可使密文变明文时,显示的字符串后面没空格

if ([sender isKindOfClass:[TTFadeSwitch class]]) {//密码显示开关

TTFadeSwitch *sw = sender;

if (!sw.on) {

self.passwordField.secureTextEntry = true;

}else{

self.passwordField.secureTextEntry = false;

[self.passwordField becomeFirstResponder];

}

}

您可能还会对下面的文章感兴趣: