我发现secureTextEntry
在iOS 11.0上不起作用,我的代码很简单:
tfPwd1.keyboardType = UIKeyboardTypeNumberPad;
tfPwd1.secureTextEntry = YES;
tfPwd1.delegate = self;
我该怎么做才能解决这个问题?
答案 0 :(得分:1)
将.secureTextEntry
更改为.isSecureTextEntry
答案 1 :(得分:0)
我只是检查我的系统使用此代码
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
txtfld.isSecureTextEntry = true
}
答案 2 :(得分:0)
你在任何地方打电话给[tfPwd1 becomeFirstResponder]
吗?在致电tfPwd1.secureTextEntry = YES;
之前添加[tfPwd1 becomeFirstResponder]
。在UIKeyboard
出现时不要添加