Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default iPad AlphaNumeric Keyboard into Numeric Mode

I have a UITextField for users to enter their street address. I have Keyboard appropriately set to Default for the field.

Since most people's street addresses start with a number, I would like it to default to numeric mode, as if the user had already pressed the .?123 key. That way, they can immediately begin entering the numeric portion of their address, and as soon as they press the spacebar, it will immediately shift back to alpha.

Is this possible?

like image 362
Mark Petereit Avatar asked Mar 27 '13 20:03

Mark Petereit


People also ask

How do I get the numeric keyboard on my iPad?

If a keyboard isn't already visible, tap the Show Keyboard button , then tap the Formula Keyboard button to begin editing a formula. To quickly enter a number or symbol on an iPad, drag down on a key and then lift your finger, or switch to the numeric keyboard on iPhone.

How do I get my iPad keyboard back to normal?

How to get your floating iPad keyboard back to normal. Place two fingers on the floating keyboard. Spread your fingers apart to enlarge the keyboard back to its full size, then let go.

Why is my keyboard typing numbers when I press letters on my iPad?

If you are not tapping down straight, it can type the number. All of the keys that have a grey letter or number character above them will do that. You can turn off Key Flicks in Settings to remove those additional characters. Go to Settings>General>Keyboards>Enable Key Flicks and turn that Off.

How do I change keyboard mode on iPad?

Go to Settings > General > Keyboard > Keyboards. Tap a language at the top of the screen, then select an alternative layout from the list.


1 Answers

There is currently no setting or options that does this. You must do it programmatically by watching for space bar input with notifications via UITextFieldTextDidChangeNotification or with the textField:shouldChangeCharactersInRange:replacementString: delegate method and then switching the keyboard.

iOS used to switch to the alphabet keyboard after a space bar even when using UIKeyboardTypeNumbersAndPunctuation. This was fixed in 5.0.

When you switch the keyboard type for a field, you're really just saying which keyboard to use next time it is displayed. If the keyboard is already being displayed, switching the type doesn't change it. So, hide the keyboard, switch the type, then show it again:

[textField1 resignFirstResponder];
[textField1.keyboardType = UIKeyboardTypeAlphabet];
[textField1 becomeFirstResponder];
like image 120
Marcus Adams Avatar answered Oct 24 '22 08:10

Marcus Adams