ios - 如何在 iOS Objective C 的数字键盘中禁用更改语言?

标签 ios objective-c keyboard uitextfield numpad

我有 texFiled 我是我的 View Controller ,我为此设置了数字键盘:

self.phoneTextField.keyboardType = UIKeyboardTypeNumberPad; 

现在我希望用户只能在文本字段中输入英文数字(不能更改语言)

enter image description here

最佳答案

(这仅适用于 iOS 10 或更高版本和数字键盘)

swift

yourTextField.keyboardType = .asciiCapableNumberPad

objective-c

yourTextField.keyboardType = UIKeyboardTypeASCIICapableNumberPad;

关于ios - 如何在 iOS Objective C 的数字键盘中禁用更改语言?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42219994/

相关文章:

iphone - UINavigationBar 背景图像通过drawRect - 提示动画问题

ios - 即使我不动也会得到不同的位置

keyboard - common lisp,如何屏蔽键盘输入

java - 尝试使用 toString 绘制坐标

iOS 7 UINavigationController 不平衡调用开始/结束外观转换

ios - UIScrollview 动画取决于内容偏移量

iOS 开发 : How can I build a complex structured iPad Application?

ios - 点击后推送不消失

ios - [UIView设置NeedsDisplay] : is there an easy way to know when drawRect is complete?

jquery - Phonegap iOS6 : Proper solution to Remove form assistant bar (prev, 接下来,完成)