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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:54:44+00:00 2026-05-28T05:54:44+00:00

I have a UIPickerView which works correctly, now I want to add a button

  • 0

I have a UIPickerView which works correctly, now I want to add a button above it so that I can dismiss it.

and here is my code where I initiate a UIPickerView as well as its dismiss button:

- (UIPickerView *)creatPickerView {
    UIPickerView *tempPickerView = [[[UIPickerView alloc] 
    initWithFrame:CGRectMake(kPickerViewX, kPickerViewY, kPickerViewWidth, kPickerViewHeight)] autorelease];
    tempPickerView.showsSelectionIndicator = YES;
    tempPickerView.delegate = self;
    tempPickerView.dataSource = self;
    UIButton *pickerButton = [[UIButton alloc] initWithFrame:CGRectMake(270, -32, 50, 32)];
    [pickerButton setBackgroundImage:[UIImage imageNamed:@"hidePicker.png"] 
         forState:UIControlStateNormal];
    [pickerButton addTarget:self action:@selector(hidePicker)   
         forControlEvents:UIControlEventTouchUpInside];
    [tempPickerView addSubview:pickerButton];
    [pickerButton release];

    [self.view addSubview:tempPickerView];
    return tempPickerView;
}

and it works well on my iPhone 4.3 Simulator, like this:

enter image description here

apparently there is a button on the upper right of the pickerView,

problem is, when I run the app in my device – a 5.0.1 iPhone4 and a 4.2.1 iTouch, the button is missed like it has never been added to the pickerView.

Can anyone help me with this?

Thanks a lot and a lot!

  • 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-28T05:54:45+00:00Added an answer on May 28, 2026 at 5:54 am

    I found the reason, it seems the png has some problem,

    after I change another png, it comes up in the screen!

    but the real problem is that I place the button outside of the pickerView which results in the button’s untouchableness.

    But anyway the pickure is only a small problem.

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

Sidebar

Related Questions

I have a uipickerview, which has a dictionary as a datasource. I want to
I have a UIPickerView to choose the PDF that should be shown. I want
I have a uipickerview which i want to populate with data from my sqlite
I have a UIPickerView as subview in a UITableViewController, which I want to slide
I have a UIPickerView. I want a done button on top of the pickerview
I have a UIPickerView in my app in which the 'tick' sound when moving
I have one mainViewController and I have a UIPickerView. Now all is set up
I have 3 row data in UIPickerView that is timeHour, timeMinute, timeSecond. How to
I have a simple iPhone app that Im learning and I want to have
I have a UIPickerView that gets faded out to 20% alpha when not in

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.