如何禁用 iOS Objective C 中数字键盘的更改语言?
How disable change language in number pad in iOS Objective C?
我有 texFiled 我是我的视图控制器,我为此设置了数字键盘:
self.phoneTextField.keyboardType = UIKeyboardTypeNumberPad;
现在我希望用户只能在文本字段中输入英文数字(不能更改语言)
NO,我们不能disable
或Hidden
键盘属性,无法处理默认的属性 Keyboardtype
在 iOS
中,如果您想对其进行自定义,那么您可以选择 Custom Keyboard
概念。否则再试一次 keyboard Types
选择 2
在那个地方你可以添加一个 Overlay
来禁用,你可以从 here.but
中获取示例
If Apple figures out that the key is covered or. disabled they will most likely reject the app.
(这仅适用于 iOS 10 或更高版本以及数字键盘)
Swift
yourTextField.keyboardType = .asciiCapableNumberPad
Objective C
yourTextField.keyboardType = UIKeyboardTypeASCIICapableNumberPad;
我有 texFiled 我是我的视图控制器,我为此设置了数字键盘:
self.phoneTextField.keyboardType = UIKeyboardTypeNumberPad;
现在我希望用户只能在文本字段中输入英文数字(不能更改语言)
NO,我们不能disable
或Hidden
键盘属性,无法处理默认的属性 Keyboardtype
在 iOS
中,如果您想对其进行自定义,那么您可以选择 Custom Keyboard
概念。否则再试一次 keyboard Types
选择 2
在那个地方你可以添加一个 Overlay
来禁用,你可以从 here.but
If Apple figures out that the key is covered or. disabled they will most likely reject the app.
(这仅适用于 iOS 10 或更高版本以及数字键盘)
Swift
yourTextField.keyboardType = .asciiCapableNumberPad
Objective C
yourTextField.keyboardType = UIKeyboardTypeASCIICapableNumberPad;