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 5971107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:28:14+00:00 2026-05-22T20:28:14+00:00

I have two UITextFields (e.g. username and password) but I cannot get rid of

  • 0

I have two UITextFields (e.g. username and password) but I cannot get rid of the keyboard when pressing the return key on the keyboard. How can I do this?

  • 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-22T20:28:14+00:00Added an answer on May 22, 2026 at 8:28 pm

    First you need to conform to the UITextFieldDelegate Protocol in your View/ViewController’s header file like this:

    @interface YourViewController : UIViewController <UITextFieldDelegate>
    

    Then in your .m file you need to implement the following UITextFieldDelegate protocol method:

    - (BOOL)textFieldShouldReturn:(UITextField *)textField
    {
        [textField resignFirstResponder];
    
        return YES;
    }
    

    [textField resignFirstResponder]; makes sure the keyboard is dismissed.

    Make sure you’re setting your view/viewcontroller to be the UITextField’s delegate after you init the textfield in the .m:

    yourTextField = [[UITextField alloc] initWithFrame:yourFrame];
    //....
    //....
    //Setting the textField's properties
    //....    
    //The next line is important!!
    yourTextField.delegate = self; //self references the viewcontroller or view your textField is on
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login screen with two textfields (username and password). When the user
I currently have two UITextFields inside two corresponding UITableViewCells. This is how it looks:
Hello I have two UITextFields in my application, and want to dismiss the keyboard
I have two webapplication, one is a simple authenticationsite which can authenticate the logged
I have one strange problem.I have two UItextfields in my view and a button.When
I have two UITextFields in the App as IBOutlets and I have made a
I'll get to this quick: I have an application for the iPhone OS 3.1.2
I am trying to do the login form I have created two uitextfields for
Have two tables with a linking table between them. USERS +-------+---------+ | userID| Username|
I have two UITextField one for Portrait and other for Lanscape View but I

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.