Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to add "Done" button on Number pad? And how to set 00.00 format for UITextField?

1.) I am new to iPhone development. I have a small application & for that I need to add number pad but there is no "Done" button. I know we can get rid of that keyboard by clinking UIView but I want a separate button for this.


2.) My second question is how to set 00.00 format for UITextField as there is no decimal point available on number pad?

iPhone 4, Mac OS X (10.2.x)

Posted on May 14, 2011 5:46 PM

Reply
2 replies

May 14, 2011 5:52 PM in response to AkshKul

As to #1, you should study the iOS HIG - doing what you have in mind might be a good way to risk rejection and not have your app make it into the store.


#2:

On devices running iOS v4.1 and greater you can use the following:

myTextField.keyboardType = UIKeyboardTypeDecimalPad;


It is tricky (and perhaps not worth the trouble) if you are trying to support older iOS versions. Here is a link to the most popular solution.

May 14, 2011 6:48 PM in response to K T

Thanks for the solution. But I am still facing a issue for decimal point. it has added a decimal point button but it is not limiting to only one decimal point. how to restrict to one decimal point only?

Also I am wondering as you said "On devices running iOS v4.1 and greater" does that mean if I use this command then my app will not work with old iPhones on which lower version of ios is present?

How to add "Done" button on Number pad? And how to set 00.00 format for UITextField?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.