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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:56:33+00:00 2026-05-24T15:56:33+00:00

I animate a custom view with a picker subview like how a keyboard appears

  • 0

I animate a custom view with a picker subview like how a keyboard appears when activating a UITextField.

Currently I do it by adding my custom view as a subview to the app’s UIWindow. If I add the the custom view as a subview to the current tab bar view controller’s view, the tab bar will cover the picker. Is there a way to animate the custom view as a subview of the current view controller without having the tab bar covering the custom view? What view does the keyboard come up on?

  • 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-24T15:56:34+00:00Added an answer on May 24, 2026 at 3:56 pm

    Just a little disclaimer: This is my first post on stackoverflow so if formatting isn’t all fine I’m sorry for that. Also, I’m fairly new to iOS programming as well as to the Objective C language, so I’m definitely not saying this is the way things ‘should’ be done. However, recently I ran into a comparable situation which I solved in a way I think is quite elegant:

    To me, it seems like using a UIPickerView could just be the preferred way to enter text into a textfield as opposed to using the regular keyboard. From a user experience point of view, to me that means the UIPickerView should (dis)appear in a similar way as the keyboard as well.

    Since iOS 3.2, UITextField supports the inputView property to assign a custom view to be used as a keyboard, which provides a way to display a UIPickerView:

    UIPickerView *myPickerView = [[UIPickerView alloc] init];
    //myPickerView configuration here...
    myTextField.inputView = myPickerView;
    

    Like that. This will not give you a direct way to dismiss the view since your UIPickerView has no return button, which is why I recommend to use the inputAccessoryView property to display a toolbar with a done button (the bar is just for aesthetics, you might as well just use a UIButton object):

    UIToolbar *myToolbar = [[UIToolBar alloc] initWithFrame:
     CGRectMake(0,0, 320, 44); //better code with variables to support view rotation
    UIBarButtonItem *doneButton =
     [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
     target:self action:@selector(inputAccessoryViewDidFinish)];
     //using default text field delegate method here, here you could call
     //myTextField.resignFirstResponder to dismiss the views
    [toolbar setItems:[NSArray arrayWithObject: doneButton] animated:NO];
    myTextField.inputAccessoryView = myToolbar;
    //you can -release your doneButton and myToolbar if you like
    

    When I reread your question, I noticed that the UIPickerView is just part of the subview. Anyway, this method works for any view so in your case you would set your subview as the UITextField’s inputView.

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

Sidebar

Related Questions

when i try to animate custom View (created in java code), there is no
My Custom View Cell looks like the following http://img34.imageshack.us/i/screenshot20110210at627.png/ @interface AddSiteAddressCell : UITableViewCell {
I'm trying to animate the movement of a custom view of mine using the
I want to animate a custom view programmatically. I want it to only animate
i made a custom view which should animate a dot on a background according
I'm trying to add a custom view to an UITableView created with code from
I need to animate the height attribute of iframe, but seems like the animate
I'm writing an iPhone app. Starting from a view controller in a navigation stack
I have a custom button on a view controller in the navigation controller's heirarchy,
I have a custom view controller that I push onto my navigation stack as

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.