Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 385337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:28:12+00:00 2026-05-12T15:28:12+00:00

I have a table and in one of the cells I keep a UITextView.

  • 0

I have a table and in one of the cells I keep a UITextView. When the user taps it the keyboard appears. I was trying various ways to get rid of it. My first approach was to detect a tap on the table cell of the UITextView, but since the text view takes most of it, it’s not suitable. Then I tried to add a button to the toolbar and whenever the user presses it, the keybord disappears with resignFirstResponder, but it won’t work. It seems that only when I’m in the same view as the UITextView resignFirstResponder works. So how can I get rid of the keyboard from a different view?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:28:12+00:00Added an answer on May 12, 2026 at 3:28 pm

    The method below uses the Return Key to dismiss the UITextView Keyboard.

    In your Controller, set the UITextView’s Delegate to self
    like this:

    myTextView.delegate=self;
    

    Then add this method:

    - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range 
     replacementText:(NSString *)text
    {
     // Any new character added is passed in as the "text" parameter
     if ([text isEqualToString:@"\n"]) {
      // Be sure to test for equality using the "isEqualToString" message
      [textView resignFirstResponder];
    
      // Return FALSE so that the final '\n' character doesn't get added
      return FALSE;
     }
     // For any other character return TRUE so that the text gets added to the view
     return TRUE;
    }
    

    This should work if you’re not using the Return key as a true Return key (e.g. adding new line).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my project I have one table with 24*6*300 cells on one page (it's
I have two table cells, with dynamic content. Table cell one works fine, when
I have a table view with numerous cells. When I press one, a tick
Using storyboard, I have a table view controller containing multiple dynamic prototype cells. One
I have two table views, when user clicks one cell of the first, second
I'm trying to setup my table so that the user can select one item
I have a T-SQL routine that copies user information from one table 'Radius' to
I have a table with 3 cells. The first one is always 50px. The
I have table on my view page. One of the cells has an ID
see fiddle i have html table and one textbox and one button.make cell selection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.