How Can I Keep the Keypad from Coming Up for a UITextField?

Discussion in 'iOS Programming' started by kaydell.leavitt, Apr 20, 2010.

  1. kaydell.leavitt macrumors regular

    Joined:
    Apr 19, 2010
    #1
    Hi,

    I'm making a specialized business calculator.

    I would like to implement my own push buttons instead of having a keyboard come up from Cocoa Touch.

    How can I do this?

    I mean that when the user touches a UITextField, I want the focus to go there, but I don't want any keyboard to appear. I want to use my own rounded-rectangle buttons.

    Thanks.

    -- Kaydell :)
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The documentation suggests that you should be putting all your custom buttons in a view and using the inputView property.

    Please read the documentation before posting questions.
     
  3. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #3
    Thank You for Your Help

    Thank you for you help.

    Give me 8 years and I'll be an iPhone demigog :D

    Kaydell
     
  4. zed2 macrumors 6502a

    Joined:
    Jul 17, 2004
    Location:
    Bucks
    #4
    Possibly a simpler solution is to use a uilabel and display your buttons on the screen. Attach the buttons to an action which string combines the uilabel and value of the button.
     
  5. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #5
    The Input View Property Requires SDK 3.2 or Later

    Thanks for the suggestion zed2, but I have a margin analysis calculator which has 3 UITextFields because the user enters any two values and calculates the third so a single label won't work.

    It looks like I need to upgrade to the 3.2 SDK to get the InputView property solution to work.

    Thanks to both of you for your help. I think that this issue is solved now.
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    This is an issue: 3.2 can only target the iPad. I imagine that property is also available in 4.0 for the iPhone but you may not have access to 4.0 yet and you can't submit apps built with 4.0 yet either...
     
  7. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #7
    Does 3.2 Require Snow Leopard

    Does 3.2 require Snow Leopard (I only have Leopard).

    -- Kaydell
     
  8. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #8
    Pretty much any SDK released since Snow Leopard requires Snow Leopard. I'm not sure what the last version that supported Leopard was. It was a long time ago...
     
  9. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #9
    I'm Running the Version of XCode That Came With Leopard.

    I'm running the version of XCode, IB, and the iPhone simulator that came with Leopard, 3.1.2.

    OK, I'll have to pay the $30.00 and do a 4 hour download to get SDK 3.2.2. I realize that 4.0 is out to developers and will be released in the summer, but I'm just a newbie at iPhone OS development.

    -- Kaydell :apple:
     
  10. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    Before you do that note my remark above: 3.2 cannot be used for iPhone apps.
     
  11. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #11
    Is There Another Solution

    Yes, I'm getting side-tracked and ahead of myself. Someday, I want to develop for the iPad, but for now, I'm developing for a second-generation iPod Touch.

    Is there another solution to my initial query on this thread? (I really can't have a keyboard popping up.)

    Is there another solution besides using a feature that isn't available to me yet?

    -- Kaydell
     
  12. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #12
    Would a Category Work

    What if I used a category to modify what a UTextField does so that the keyboard doesn't popup; then, I could just use some rounded-rectangle buttons in that same view.

    Would that work?

    -- Kaydell
     
  13. zed2 macrumors 6502a

    Joined:
    Jul 17, 2004
    Location:
    Bucks
    #13
    just disable the UITextField, so the users can't select it!
     
  14. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #14
    Thanks

    Thanks. I think that will do it. I'll just disable the UITextFields in IB.

    -- Kaydell :):):)
     
  15. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #15
    Wait a Minute

    If I disable the UITextFields, then I won't be able to tell which one that the user touched and the user won't see a cursor in there either.

    Right?

    -- Kaydell :confused:
     

    Attached Files:

  16. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #16
    I recommend that you work with the existing keyboard implementation in 3.1.3. The keys on the keyboard you show are the same as the numeric keyboard except that you add the decimal point and enter key.

    What other apps have done with this problem is to either add keys to the background view so that they're available when the keyboard is visible or they add an accessory view with extra keys that looks like the keyboard and slides in at the top of the keyboard view. Apple has rejected apps that actually modify the keyboard view itself but adding your own view that slides in with the keyboard view is ok.

    If you develop for a later version of the OS that adds better support for customization of the keyboard at some point you can update your code.
     
  17. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #17
    Thanks

    Thanks, I'll do that. It's simple enough for me to add a single decimal-point button, it just doesn't look so good.

    -- Kaydell :);):)
     
  18. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #18
    I Believe that SDK 3.2.2 *Does* Support the iPhone and the iPod Touch

    My download of the iPhone SDK just finished and it seems that earlier in this thread that we concluded that the 3.2.2 was only for iPads. This is not so.

    The confusion stemmed from talking about how to develop apps that only will run on the iPad.

    3.2.2 *does* support a universal app (see the picture below), but it *does* require an upgrade for me to Snow Leopard.

    -- Kaydell :)
     

    Attached Files:

  19. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #19
    This is true but, unless my understanding is wrong, even developed with the 3.2.2 SDK you cannot use anything added in 3.2 on the iPhone...
     
  20. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #20
    There Are Two SDK Versions: 1) Development and 2) Deployment

    If you'll look at the picture in my last post again, you'll see that there are two versions 1) Development and 2) Deployment.

    I believe that I can develop with the 3.2.2 SDK and deploy to the 3.1.3 SDK.

    -- Kaydell
     
  21. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #21
    We Were Right About Snow Leopard Being Required

    I tried to install the iPhone OS version 3.2.2 on my Leopard Mac but it doesn't install. (See picture below in this post).

    I believe that the upgrade from Leopard to Snow Leopard is only $30.00 USD.

    -- Kaydell
     

    Attached Files:

  22. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #22
  23. kaydell.leavitt thread starter macrumors regular

    Joined:
    Apr 19, 2010
    #23
    Maybe you're right, but in any case, I want to purchase Snow Leopard

    -- Kaydell :)
     

Share This Page