How can I create a number pad with a decimal point separator character option in Xcode's Interface Builder Storyboard?
Changing Keyboard Type
to Number Pad
doesn't show a decimal option:
Here's a longer answer: on an iPhone, you enter decimals by pressing the +*# button in the lower-left corner of the keypad and pressing either * or #.
Have figured it out with the help of Ross at the V & A Waterfront Apple Store. System Preferences- Language and Region- at the bottom of the box click "Advanced"- then choose the dot/ comma under Number separators- Decimal and again under drop down box "decimal" under currency. Good job!
The decimal key can appear in two places on the US keyboard, in the bottom row of main keys to the right of 'M', or in an optional numeric keypad. The behavior should be the same regardless of which key is used to enter a decimal.
In iOS 4.1, there is a number pad with a decimal point available. You can select it programatically (in case you are supporting versions of iOS before 4.1) like so:
inputBoxTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation; if (([[[UIDevice currentDevice] systemVersion] doubleValue] >= 4.1)) { inputBoxTextField.keyboardType = UIKeyboardTypeDecimalPad; }
You could choose any appropriate keyboard type (line 1). In this case, NumbersAndPunctuation includes a period in case the user's iOS version is before 4.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With