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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:21:14+00:00 2026-06-03T06:21:14+00:00

i have 2 custom right bar button items, and in portrait mode they overlays

  • 0

i have 2 custom right bar button items, and in portrait mode they overlays each others and only one of them is visible, but on landscape mode both are visible. items are created with custom view which is the UIButton with background image.

optionsBUtton=[UIButton buttonWithType:UIButtonTypeCustom];
[optionsBUtton setImage:[UIImage imageNamed:@"optionsIcon.png"] forState:UIControlStateNormal];
[optionsBUtton setBackgroundImage:[UIImage imageNamed:@"optionsBtn.png"] forState:UIControlStateNormal];
[optionsBUtton sizeToFit];
UIBarButtonItem* btnOptions=[[UIBarButtonItem alloc] initWithCustomView:optionsBUtton];

searchButton=[UIButton buttonWithType:UIButtonTypeCustom];
    [searchButton setImage:[UIImage imageNamed:@"searchIcon.png"] forState:UIControlStateNormal];
    [searchButton setBackgroundImage:[UIImage imageNamed:@"optionsBtn.png"] forState:UIControlStateNormal];
    [searchButton sizeToFit];
    UIBarButtonItem* btnSearch=[[UIBarButtonItem alloc] initWithCustomView:searchButton]; 

rightButtonItems=[[NSArray alloc] initWithObjects:btnOptions,btnSearch, nil];
    navItem.rightBarButtonItems=rightButtonItems;
  • 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-06-03T06:21:15+00:00Added an answer on June 3, 2026 at 6:21 am

    you must user tool bar and set the toolbar with buttons here is example code

    // create a toolbar where we can place some buttons
    UIToolbar* toolbar = [[UIToolbar alloc]
                            initWithFrame:CGRectMake(0, 0, 100, 45)];
    [toolbar setBarStyle: UIBarStyleBlackOpaque];
    
    // create an array for the buttons
    NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:3];
    
    // create a standard save button
    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc]
        initWithBarButtonSystemItem:UIBarButtonSystemItemSave
        target:self
        action:@selector(saveAction:)];
    saveButton.style = UIBarButtonItemStyleBordered;
    [buttons addObject:saveButton];
    [saveButton release];
    
    // create a spacer between the buttons
    UIBarButtonItem *spacer = [[UIBarButtonItem alloc]
        initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
        target:nil
        action:nil];
    [buttons addObject:spacer];
    [spacer release];
    
    // create a standard delete button with the trash icon
    UIBarButtonItem *deleteButton = [[UIBarButtonItem alloc]
        initWithBarButtonSystemItem:UIBarButtonSystemItemTrash
        target:self
        action:@selector(deleteAction:)];
    deleteButton.style = UIBarButtonItemStyleBordered;
    [buttons addObject:deleteButton];
    [deleteButton release];
    
    // put the buttons in the toolbar and release them
    [toolbar setItems:buttons animated:NO];
    [buttons release];
    
    // place the toolbar into the navigation bar
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
                                               initWithCustomView:toolbar] autorelease];
    [toolbar release];
    

    Thanks..!

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

Sidebar

Related Questions

I have custom gallery. Gallery represents items that are frame layout. There are one
I have custom UITableViewCell s as well as headers and footers. Each of them
I have made a custom button bar as described here . Now, I want
What is the best way to have the right navigation bar button flip like
I want to add a custom button (to the right) in my navigation bar.
Right now I have a Drupal site where I'm integrating a custom front-end interface
I have custom server control contains templatefield when an out button clicked the field
In the tableview the user can tap the upper right button (navigation bar rightside)
I have created a custom scroll bar for the jscrollpane which appears to be
HI Everyone, I have a navigation bar with a navigation controller. In one of

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.