6

Right now I am using learning to program for the iphone and I am using a sample application that has the standard numeric keypad. I need to enter decimal points too but the numeric keypad does not have any. The SDK 4.1 supports this feature but I cannot set the keyboard type to be UIKeyboardTypeDecimalPad, at least I do not see the option in Interface Builder. Can this be done from the Interface Builder? if not then where can add this in code?

thank you.

Cecile
  • 89
  • 2
  • 4

2 Answers2

12

You need to add this in your code. Interface builder doesn't seem to use it yet. You should be able to add it in for your UITextField in the viewDidLoad method of your controller. Of course, your text field will need to be wired to an IBOutlet.

- (void)viewDidLoad
{
    [super viewDidLoad];
    myTextField.keyboardType=UIKeyboardTypeDecimalPad;
}
Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
0

As an aside, note that the UIKeyboardTypeDecimalPad doesn't seem to work on iPad.

Weird error while using UITextFieldDelegate

Which UIKeyboardType can I use on the iPad

Community
  • 1
  • 1
Max Strater
  • 540
  • 6
  • 17