Adding button to NavBar

Discussion in 'iOS Programming' started by iLoveDeveloping, Feb 1, 2010.

  1. iLoveDeveloping macrumors 6502

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #1
    How do you get a keyboard OFF screen?

    I have one popping up in a View when writing to a 'text view'. But how do i programme it to disappear when i need it to? Like a blue done button in the corner?
     
  2. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
  3. iLoveDeveloping thread starter macrumors 6502

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #3

    Would this work?


    Code:
    - (void)textFieldDidEndEditing:(UITextField *)textField
    or

    Code:
    - (BOOL)textFieldShouldReturn:(UITextField *)textField
     
  4. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
    #4
    Try this:
    Code:
    [textfield resignFirstResponder];
     
  5. iLoveDeveloping thread starter macrumors 6502

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #5
    Perfect, thank you young one.... :eek:
     
  6. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
    #6
    no problem, just remember, that is a UITextFieldDelegate method. Also note the section at the top "managing the keyboard".
     

Share This Page