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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:39:47+00:00 2026-05-28T07:39:47+00:00

I am implementing picker by Add UIPickerView & a Button in Action sheet –

  • 0

I am implementing picker by Add UIPickerView & a Button in Action sheet – How?. I tried to replace the UISegmentedControl with a UIButton but it does not working. Could someone remind me why UIButton cannot be shown here?

Thank you.

- (IBAction) makeButtonPressed: (id) sender;
{
    UIActionSheet *actionSheet = [[UIActionSheet alloc] init];
    [actionSheet setTitle:@"Select Make"];
    [actionSheet setActionSheetStyle:UIActionSheetStyleBlackOpaque];

    UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 44, 0, 0)];
    pickerView.dataSource = self;
    pickerView.delegate = self;
    pickerView.showsSelectionIndicator = YES;
    [actionSheet addSubview:pickerView];

//  UISegmentedControl *doneButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]];
//  doneButton.momentary = YES; 
//  doneButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
//  doneButton.segmentedControlStyle = UISegmentedControlStyleBar;
//  doneButton.tintColor = [UIColor blackColor];
//  [doneButton addTarget:self action:@selector(makeDone:) forControlEvents:UIControlEventValueChanged];
//  [actionSheet addSubview:doneButton];

    UIButton *doneButton = [[UIButton alloc] init];
    doneButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
    [doneButton addTarget:self action:@selector(makeDone:) forControlEvents:UIControlEventValueChanged];
    [actionSheet addSubview:doneButton];

    [actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];

    [actionSheet setBounds:CGRectMake(0, 0, 320, 460)];
}
  • 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-28T07:39:48+00:00Added an answer on May 28, 2026 at 7:39 am

    The designated initializer for UIButton is +buttonWithType:. You should create your button with one of the predefined styles, or use UIButtonTypeCustom.

    UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeRoundRect];
    doneButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
    [doneButton addTarget:self action:@selector(makeDone:) forControlEvents:UIControlEventValueChanged];
    [actionSheet addSubview:doneButton];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing an in-app browser using UIWebView, that shows an 'action' button up-top
I'm implementing a colour picker component as described in this seminal article . As
Are there any examples/recommended approaches for implementing a location picker (for want of a
Im implementing NFS and almoste done but the RFC section 3.3.8 says this in
I am implementing a MPMediaPickerController based application. In that When I tried to open
I am implementing picker view with double component Toggle with Celsius and Fahrenheit two
I`m implementing a custom filesystem on Ubuntu using Fuse, but I need to trap
I'm trying to make a color picker in Silverlight similar to this one but
I'm implementing a color picker. There is problem with the rendering. When I call
Implementing Equals() for reference types is harder than it seems. My current canonical implementation

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.