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

  • Home
  • SEARCH
  • 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 4578568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:31:25+00:00 2026-05-21T20:31:25+00:00

I am trying to add subview contains uipickerview and Done button using the following

  • 0

I am trying to add subview contains uipickerview and Done button using the following code

    pickerView = [[UIPickerView alloc]initWithFrame:CGRectMake(0,744, 768, 216)];
    mytab = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 700, 768, 44)];

    pickerView.alpha=0.0;
    mytab.alpha=0.0;


    pickerView.showsSelectionIndicator = YES;
    pickerView.dataSource = self;
    pickerView.delegate = self;

    [self.view addSubview:pickerView];
    [self.view bringSubviewToFront:pickerView]; 


    mytab.tintColor=[UIColor blackColor];

    UIBarButtonItem * bt1=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonItemStylePlain target:self action:@selector(_cancel)];
    UIBarButtonItem * flx=[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];

    NSArray *arr=[[NSArray alloc] initWithObjects:flx,bt1,nil];
    [mytab setItems:arr];
    [self.view addSubview:mytab];

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.3];
    pickerView.alpha=1.0;
    mytab.alpha=1.0;
    [UIView commitAnimations];


    [pickerView release];
    [mytab release];
    [bt1 release];
    [flx release];
    [arr release];

it raise the following error

cannot convert ‘UIBarButtonItemStyle’ to ‘UIBarButtonSystemItem’ in argument passing

aany suggestion to solve that

  • 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-21T20:31:26+00:00Added an answer on May 21, 2026 at 8:31 pm
    typedef enum {
        UIBarButtonSystemItemDone,
        UIBarButtonSystemItemCancel,
        UIBarButtonSystemItemEdit,  
        UIBarButtonSystemItemSave,  
        UIBarButtonSystemItemAdd,
        UIBarButtonSystemItemFlexibleSpace,
        UIBarButtonSystemItemFixedSpace,
        UIBarButtonSystemItemCompose,
        UIBarButtonSystemItemReply,
        UIBarButtonSystemItemAction,
        UIBarButtonSystemItemOrganize,
        UIBarButtonSystemItemBookmarks,
        UIBarButtonSystemItemSearch,
        UIBarButtonSystemItemRefresh,
        UIBarButtonSystemItemStop,
        UIBarButtonSystemItemCamera,
        UIBarButtonSystemItemTrash,
        UIBarButtonSystemItemPlay,
        UIBarButtonSystemItemPause,
        UIBarButtonSystemItemRewind,
        UIBarButtonSystemItemFastForward,
    #if __IPHONE_3_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED
        UIBarButtonSystemItemUndo,
        UIBarButtonSystemItemRedo,
    #endif
    #if __IPHONE_4_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED
        UIBarButtonSystemItemPageCurl,
    #endif
    } UIBarButtonSystemItem;
    

    UIBarButtonItemStylePlain is not available for UIBarButtonSystemItem. It is available for UIBarButtonItemStyle

    typedef enum {
        UIBarButtonItemStylePlain,    // shows glow when pressed
        UIBarButtonItemStyleBordered,
        UIBarButtonItemStyleDone,
    } UIBarButtonItemStyle;
    

    you can try - (id)initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style target:(id)target action:(SEL)action; for your button

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

Sidebar

Related Questions

I'm trying to add a view as a button's subview like this ( btn1
I'm trying to add a subview to a tableview cell and of course using
I'm trying add a tab to my web page that looks like this: Using
I'm trying to add a subview to a UITableViewCell and the design that I'm
I am trying to add another subview programmatically based on some event (user taps
I'm trying to add a UIWebView as a subview of a UITableViewCell in order
I'm trying to add a UIPicker as a subview, but can't quite figure it
Im trying to add a subview, and then also remove the previous view. here
I'm trying to add as subview into a section in UITableView, It looks like
I am trying to add a subview to a UITableViewController 's view via the

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.