How to use the new UIKeyboardTypeDecimalPad feature in iOS 4.1 SDK

I am currently using the iphone app training, and I am using an example application that has a standard numeric keypad. I also need to enter decimal points, but the numeric keypad does not have. The SDK 4.1 supports this function, but I cannot set the keyboard type to UIKeyboardTypeDecimalPad, at least I do not see this parameter in Interface Builder. Can this be done from the Builder interface? if not, where can I add this to the code?

thanks.

+6
iphone
source share
2 answers

You need to add this to your code. The interface designer does not seem to use it yet. You should be able to add it for your UITextField in the viewDidLoad method of your controller. Of course, your text box should be connected to IBOutlet.

- (void)viewDidLoad { [super viewDidLoad]; myTextField.keyboardType=UIKeyboardTypeDecimalPad; } 
+12
source share

Note that UIKeyboardTypeDecimalPad does not work on the iPad.

Strange error when using UITextFieldDelegate

What type of UIKeyboardType can I use on an iPad

0
source share

All Articles