开发者

UITextField property keyboardType not showing as expected

I have a popover that accepts input into a UITextField. Depending on the input, I set the properties: text, keyboardType, returnKeyType, and keyboardAppearance. The text and returnKeyType properties are reflected in the popover. But I get a standard keyboard, with numbers (UIKeyboardTypeNumberPad, UIKeyboardTypeDecimalPad) or letters (UIKeyboardTypeDefault) showing. I expected to see the "enter pin" keyboard for UIKeyboardTypeNumberPad and numbers with a period for the UIKeyboardTypeDecimalPad keyboardType.

My code...

.h:

@interface IFDTextPopoverContentViewController : UIViewController {
UILabel *notes;
UITextField *input;
}

@property (nonatomic, retain) IBOutlet UILabel *notes;
@property (nonatomic, retain) IBOutlet UITextField *input;

.m:

        IFDTextPopoverContentViewController *textPopover = (IFDTextPopoverContentViewController *)textPopoverController.contentViewController;
        textPopover.input.text = [xmlResults valueForKey:question.XmlAttrib];
        textPopover.input.keyboardType = UIKeyboardTypeNumberPad;
        textPopover.input.keyboardAppearance = UIKeyboardAppearanceDefault;
        textPopover.input.returnKeyType = UIReturnKeyDone;
        textPopover.notes.text = question.Notes;

Am I missing something to change the keyboardType? I am currently running this on an iPad. I have开发者_如何学Go not tested on an iPhone.

Another option might be to add a numeric or numeric+decimal keypad to the popover, but I do not know where to start on this option.


The iPad has no keypad keyboard. So it shows you the normal number keyboard instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜