How do I close the keyboard

Discussion in 'iOS Programming' started by iphonedevelop18, Mar 16, 2009.

  1. iphonedevelop18 macrumors member

    Feb 26, 2009
    Say I have a text field and I open the keyboard up by clicking on it, how then do I close the keyboard as there are buttons underneath that need to be pushed.
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Please read the iPhone Application Programming Guide first.
  3. yayaba macrumors 6502

    Apr 24, 2007
    San Francisco Bay Area
    You need to assign the UITextField's delegate to whatever is the parent of the UITextField. Then use the delegate function that corresponds to whether or not to use the Return key and in that function return YES and resign the first responder.

    I'm not 100% sure of the concept of first responders though, I just know it needs to be done...

Share This Page