How do you set the popup keyboard to only show certain keys when you type into a textfield? I know there are default keyboards but none seems suitable. Is there an alternative input option? Thanks.
3 Answers
Since iOS 3.2, you can change the keyboard :
cf. Official documentation here
Discussion
The value of this property is nil. Responder objects that require a custom view to gather input from the user should redeclare this property as readwrite and use it to manage their custom input view. When the receiver subsequently becomes the first responder, the responder infrastructure presents the specified input view automatically. Similarly, when the view resigns its first responder status, the responder infrastructure automatically dismisses the specified view.
This property is typically used to replace the system-supplied keyboard that is presented for UITextField and UITextView objects.

- 16,974
- 6
- 49
- 60
-
Thanks santoni, I've thought about using buttons as keys for the InputView but it seems a bit overkill for a simple task - but it does look like this is the only option for customised keys. – mlam Jul 22 '10 at 09:38
Apple wont allow you to do any alterations to the keyboards..
What do you want to enter? Either create a custom keyboard, use pickers if possible or code it to not accepts certain keys..

- 2,196
- 18
- 23
-
I only want the user to enter numbers and the decimal point, with all other options disabled? – mlam Jul 22 '10 at 09:25
-
Okay. I did'nt know you were allowed to change the keyboard now.. I usually use a picker. and have one of the segments just contain a "," the rest of the segments are 0-9.. or you could do something like this: http://stackoverflow.com/questions/276382/best-way-to-enter-numeric-values-with-decimal-points But since its okay to change the keyboard now try this: http://blog.devedup.com/index.php/2010/03/13/iphone-number-pad-with-a-decimal-point/ – LarsJK Jul 22 '10 at 10:20
Okay. I did'nt know you were allowed to change the keyboard now..
I usually use a picker. and have one of the segments just contain a "," the rest of the segments are 0-9..
or you could do something like this:
What is the best way to enter numeric values with decimal points?
But since its okay to change the keyboard now try this:
http://blog.devedup.com/index.php/2010/03/13/iphone-number-pad-with-a-decimal-point/
-
Both links are great alternatives, but they don't provide the flexibility that I need. I'll definitely keep those options in mind for future projects though. thanks. :) – mlam Jul 22 '10 at 12:32