我UITextFields在桌子上输入值.其中一些字段仅接受数字.我UIKeyboardTypeNumbersAndPunctuation用于keyboardType,并shouldChangeCharactersInRange过滤字符.
此外,所有更正都被禁用:
textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
textField.autocorrectionType = UITextAutocorrectionTypeNo;
textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
Run Code Online (Sandbox Code Playgroud)
在仅数字字段上,触摸空格键时,键盘将更改为字母.我知道这是默认行为.我想忽略空格键,不希望键盘类型改变.
有没有办法改变这种默认行为?
PS:其他数字键盘类型不是一个选项.我需要标点符号!
谢谢