【发布时间】:2014-02-22 08:51:41
【问题描述】:
_text = [[UITextField alloc] initWithFrame:CGRectZero];
_text.font = [Styles bodyFont];
_text.text = ((EditTextBubble *)(toEdit.bubble)).textLabel.text;
if ([_text.text isEqualToString:[@"E.g. " stringByAppendingString:((EditTextBubble *)toEdit.bubble).placeholder]]) _text.text = @"";
_text.textAlignment = NSTextAlignmentLeft;
_text.delegate = self;
_text.userInteractionEnabled = NO;
[self addSubview:_text];
_text.keyboardType = UIKeyboardTypeNumberPad;
我正在尝试让数字键盘 (http://cdn.arstechnica.net/wp-content/uploads/2013/09/keypad.png) 为 UITextField 工作,但我得到的只是数字页面上的普通键盘,而不是上面的谷歌图片。你如何让它工作?这是在 iOS 7 和 ipod/ipad 上,没有 nib 文件。
【问题讨论】:
-
屏幕截图中的键盘仅出现在 iPhone 或 iPod touch 上。在 iPad 上,您将获得全键盘。
-
所以我必须自己制作小键盘?
-
不,完整的 iPad 键盘显示数字。
标签: ios keyboard uitextfield