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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:37:17+00:00 2026-06-05T10:37:17+00:00

I am building a converter app. In the main screen I have a text

  • 0

I am building a converter app. In the main screen I have a text field to input numbers and below the text field a picker view will allow users to select conversion parameters, (for example kg to g).

I can hide the keyboard when user click the background by using the following method

 (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
 [self.enterInput resignFirstResponder];

but when I touch the picker view the keyboard is not hiding.

My question is how to dismiss the keyboard when a user touches the picker view.

  • 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-06-05T10:37:19+00:00Added an answer on June 5, 2026 at 10:37 am

    Got a solution

    1) First Create a hidden roundRect botton and change the type to custom (fit the size of the picker).

    2) Create a touch up inside action

     - (IBAction)hiddenButtonToHideKeyboard:(id)sender {
        [self.enterInput resignFirstResponder];
    }
    

    3) Create a keyboard appear notification

    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(onKeyboardAppear:) name:UIKeyboardWillShowNotification object:nil];
    

    4) Create a keyboard disappear notification

     [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(onKeyboardHide:) name:UIKeyboardWillHideNotification object:nil];
    

    5) Make the button visible when keyboard is appeared

     -(void)onKeyboardAppear:(NSNotification *)notification
    {
        hiddenButtonToHideKeyboard.hidden=NO;
    }
    

    6) Hide the button when the keyboard is disappeared

    -(void)onKeyboardHide:(NSNotification *)notification
    {
        hiddenButtonToHideKeyboard.hidden=YES;
    }
    

    5) done

    I dont think it is a perfect solution but it works for me 🙂

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

Sidebar

Related Questions

I'm building a web-app that will allow users to drag and drop from a
I'm building an Android app using Eclipse. If I have a single Drawable folder
I have a problem in an app I am building. I can retrieve the
I'm building an app that has a main Activity that takes advantage of the
I am building a Windows Phone app which uses the camera. I have the
I am building an app that can track weight. I allow the user to
I am building an HTML5 app for an iPad and it will contain a
I am building a Tab Bar App and have a MapView set up on
I'm building a desktop to-do list app, and in my UI I have a
I am building a web-app that will users mark-up images by drawing on it

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.