UITextView won't dismiss keyboard

Discussion in 'iOS Development' started by Chicken, May 12, 2009.

  1. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    OK so I'm trying to dismiss the keyboard of a UITextView, it's never been a problem with UITextField's so here is my code

    Code:
    - (BOOL)textViewShouldReturn:(UITextView *)textView {
        [textView resignFirstResponder];
    }
    and yes I have set the delegate of the UITextView. Just wondering why it's not working.

    **EDIT**

    Found out there isn't a method like that, time to do a little keyboard hacking.
  2. iPodTouchDev

    iPodTouchDev New Member

    Joined:
    Jan 18, 2009
    Messages:
    74
    Likes Received:
    0
    Device:
    iPod touch

    did you add

    Code:
    textView.delegate = self;
    to your

    Code:
    -(void)viewDidLoad
    ??
  3. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Does that answer your question....
  4. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Oh, God. Don't use a UITextView if you can possible avoid it! It's expensive as crap!
  5. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Yeah it's OK, I figured another way to do it.

    Please Register or Log in to view images

Share This Page