【发布时间】:2014-07-17 06:23:06
【问题描述】:
我正在开发一个应用程序,它有一个text-field,它应该只接受numbers,所以我创建了一个custom keyboard,它只有[0-9] 作为接受的输入。要使用这个custom keyboard,必须转到setting-->keyboards 然后接受这个,然后从应用程序中打开特定的键盘。
这是否可以强制用户只打开custom keyboard 而无需进入设置选项。我希望每当用户打开应用程序时.. 只有 custom keyboard 应该打开,而不是其他
【问题讨论】:
-
为什么不默认设为数字呢? UITextField *numericTextField = [[UITextField alloc] initWithFrame:CGRectMake(100, 10, 185, 30)]; numericTextField.adjustsFontSizeToFitWidth = YES; numericTextField.keyboardType = UIKeyboardTypeNumberPad; [parentView addSubview:numericTextField];
-
你不要为这个文本字段设置
_textField.keyboardType = UIKeyboardTypeNumberPad,键盘只显示数字键盘 -
@Shan 我想为 iOS8 设置自定义键盘,而不是苹果的默认键盘
-
@user3226440:我们想问的是:您有什么特别的理由要重新发明轮子吗?数字键盘已经有了,为什么还要自己实现呢?
标签: ios iphone ios8 ios-app-extension uiinputviewcontroller