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

  • SEARCH
  • Home
  • 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 7603729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:43:46+00:00 2026-05-30T23:43:46+00:00

I want to hide keyboard on UITextField end editing event but somehow I am

  • 0

I want to hide keyboard on UITextField end editing event but somehow I am not able to get following code working! When I press Done button, it hides the keyboard but not when I don’t press done button and move to another UITextField where I don’t need keyboard but UIPickerView. Basically UIPickerView is appearing but behind the keyboard. I am resigning current UITextField on end editing event as well as on begin editing for required text fields. The begin editing code works fine if I don’t have keyboard already shown for previous UITextField. Could someone please tell me what am I doing wrong?

Following sequence works:

  1. Select normal UITextField and insert text, press done button (this hides keyboard)
  2. Select picker UITextField (this displays picker view)

..but following doesn’t:

  1. Select normal UITextField and insert text
  2. Select picker UITextField (the picker view is behind the keyboard as I didn’t press done button for previous UITextField). Here it calls end editing but it doesn’t hide keyboard!

    - (BOOL)textFieldShouldReturn:(UITextField *)textField {
        [textField resignFirstResponder];
        scrollView.contentSize = CGSizeMake(320, 750);
        [scrollView setFrame:CGRectMake(0, 0, 320, 480)];
        return YES;
     }
    
    -(void)textFieldDidEndEditing:(UITextField *)textField  
    {
        [textField resignFirstResponder];
    }
    
    - (void)textFieldDidBeginEditing:(UITextField *)textField {
        DatePicker.hidden = YES;
        CountryPickerView.hidden = YES;
    
        switch (textField.tag) {
            case 3:
                [textField resignFirstResponder];
                DatePicker.hidden = NO;
                return;
            case 6:
                [textField resignFirstResponder];
                CountryPickerView.hidden = NO;
                return;
            default:
                break;
        }
        scrollView.contentSize = CGSizeMake(320, 650);
        [scrollView setFrame:CGRectMake(0, 0, 320, 260)];
    }
    
  • 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-30T23:43:47+00:00Added an answer on May 30, 2026 at 11:43 pm

    it hides the keyboard but not when I don’t press done button and move
    to another uitextfield where I don’t need keyboard but PickerView.

    The right way to handle this is to set the inputView property for the field that uses a picker instead of the keyboard. Configure the picker as you need it (set up delegate, data source, etc.) and then set it as the field’s inputView. The system will handle hiding the keyboard and showing the picker view, or vice versa, as you move from one field to the next.

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

Sidebar

Related Questions

How to hide/disable keyboard ,if the textview editing is enabled. I only want to
I have UITextField which have keyboard type Numpad. I want to be able to
I want to hide the keyboard after typing the content into the UITextView but
I want to know when my keyboard will hide, to scroll to the top
In a TextBox input. After type enter key, i want to hide soft keyboard.
I want to hide keyboard when a user presses return in UITextView object in
I have the following code... - (void)textFieldDidBeginEditing:(UITextField *)textField { //some code here... NSInteger theTag
In my app i want hide keyboard when i start scrolling UITableView. I search
I was following the code here #pragma mark UITextFieldDelegate - (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField
When the user presses editText, the soft keyboard pops up. I want to hide

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.