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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:03:18+00:00 2026-06-04T01:03:18+00:00

I have 3 UITexfield, the user can fill in the first two, but the

  • 0

I have 3 UITexfield, the user can fill in the first two, but the last one is a category field and displays a UIPickerView when it’s clicked.

What I’ve managed to do so far is :

  • The user clicks on the catergory textfield -> the picker view appears
  • Then the user clicks on another textfield -> the picker view disappears and the keyboard shows up

But know I would like to hide the keyboard when the user clicks agains on the category textfield and show the picker view.

This is what I have so far :

- (void)textFieldDidBeginEditing:(UITextField *)textField {
    if(textField == categoryTextField){
        [categoryTextField resignFirstResponder];
        [UIView beginAnimations:@"picker" context:nil];
        [UIView setAnimationDuration:0.3];
        pickerView.transform = CGAffineTransformMakeTranslation(0,-236);
        [UIView commitAnimations];
    }else{
        [UIView beginAnimations:@"picker" context:nil];
        [UIView setAnimationDuration:0.3];
        pickerView.transform = CGAffineTransformMakeTranslation(0,236);
        [UIView commitAnimations];
    }
}

But it doesn’t work. Any thought why ?

  • 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-04T01:03:19+00:00Added an answer on June 4, 2026 at 1:03 am

    You’re making it too difficult. Set the picker view as the input view of the textfield, and the OS will take care of the animations for you. As each field becomes first responder, the appropriate input view (default keyboard for the text ones, your picker for the third one) will be displayed. You don’t need to do any animations yourself.

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

Sidebar

Related Questions

I have a UITextField where user can enter a name and save it. But,
I want to have a UISegmentedController but the user can choose the segment and
In my app, I have a textbox that the user can fill. Most times,
I have an app with a UITextField, amongst other things. When the user first
I have a UITableView with custom UITableViewCells. The table has two sections, the first
I have two views with navigation controller: first view, there are empty text fields
I'm currently developing an iPhone app where I have two UITextField's in one View
Alright. Lets say i have a UITextField where a user can input an url
I have a table with a list of employee data. User can select the
I have a question about text field. I am writing to let the user

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.