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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:42:08+00:00 2026-05-21T07:42:08+00:00

I have a UI issue. Initially I wanted to have 2 pickers to populate

  • 0

I have a UI issue. Initially I wanted to have 2 pickers to populate 2 different labels. The problem is using 2 pickers on the ui will take up all the space on the window and you cannot resize the pickers.

I realized since I am using the same data in each of the pickers I should be able to get away with using one picker control. Except it will be a little confusing to the user if the focus of the control isnt done properly.

I would like for it to work kinda like the keyboard coming up in a textbox.

So I have a simple UI

Get Data 1: Textbox1
Get Data 2: Textbox2

A picker

When the user clicks inside textbox1 a picker appears instead instead of the keyboard and populates the textbox with the selected data off the picker. The same happens for textbox2.

Can someone give me a sample of how this maybe accomplished, or a better way to approach this? How do you guys handle having to have 2 dropdown menus on the same window?

  • 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-21T07:42:09+00:00Added an answer on May 21, 2026 at 7:42 am

    A picker with two components and two labels (or textfields) is a good solution if your text isn’t too long.

    Edited to add

    Here’s a picker with two components that I just whipped together.

    UIPickerView with two components

    Further edited to add

    Here’s some code to show you how it’s done:

    Set up the components

    - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
        return 2;
    }
    

    Set up the rows

    - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
        if (component == 0) {
            return [array1 count];
        } else {
            return [array2 count];
        }
    }
    

    Provide data for the rows

    - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
        if (component == 0) {
            return [array1 objectAtIndex:row];
        } else {
            return [array2 objectAtIndex:row];
        }
    }
    

    Change the labels based on changes in the picker

    - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
        if (component == 0) {
            label1.text = [array1 objectAtIndex:row];
        } else {
            label2.text = [array2 objectAtIndex:row];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue when playing video while using the c willRotateToInterfaceOrientation function. Initially,
I have an issue that is driving me a bit nuts: Using a UserProfileManager
We have an issue using the PEAR libraries on Windows from PHP . Pear
I have an issue with using AWK to simply remove a field from a
The issue I have a <div> on a page which is initially hidden with
I have an issue with jquery ui modal box. I initially opened the modal
i've just run into the infamous tombstoning problem/issue in WP7. let's say i have
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
We have an issue related to a Java application running under a (rather old)
We have an issue on our page whereby the first time a button posts

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.