How to remove a number pad

Discussion in 'iOS Programming' started by MaxFreud, Feb 11, 2011.

  1. MaxFreud macrumors newbie

    Jan 5, 2011
    Hi all.

    Very simple problem:

    I have two textfields. They're both supposed to take in only numbers, so in IB I set the keyboard type to number pad. The problem is that there is no "Done" button on a number pad by default.

    So I was hoping to add one of those little toolbar on top of the keyboard to provide buttons for switching between fields and a "done" button. I can't for the life of me figure out how to do this. I tried with a UIToolbar, but that pushes the buttons to the left, and I want it on the right.

    I know I can make the textfields give up firstResponder status with a background tap but I think that's really unintuitive for users if its the only means available.

    Any ideas?
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    I use a toolbar for this. Just add a flexible space as the first item to force all the other buttons to the right.
  3. MaxFreud thread starter macrumors newbie

    Jan 5, 2011
    Awesome. I didn't know about spaces on toolbars. Thanks a lot.
  4. Skov macrumors newbie

    Feb 13, 2011
  5. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    This can be achieved through the use of Input Accessory Views.

Share This Page