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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:35:14+00:00 2026-06-13T01:35:14+00:00

I have a UIToolbar that has two buttons, two flexible margins and a segment

  • 0

I have a UIToolbar that has two buttons, two flexible margins and a segment control within it. I have it set up so that when the user selects the refresh button, the button is hidden, a activity indicator takes its place, and once the operation is done, the button is put back and the activity indicator is stopped. The only way to hide UIBarButtonItems is to remove the from the toolbar array and then re-add them when needed. That is all fine and dandy. My question is, when I re-add the object, how do I specify it’s place in the array. Right now it adds the object to the end of the array, there for the button is on the far right. I would like it to be on the left side. My code is below. Thanks.

toolbarItems = [mapToolbar.items mutableCopy];
[toolbarItems removeObject:refreshButton];
mapToolbar.items = toolbarItems;

spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
spinner.center = CGPointMake(298, 22);
[mapToolbar addSubview:spinner];
[spinner startAnimating];

do operation....

[toolbarItems addObject:refreshButton];
mapToolbar.items = toolbarItems;

[spinner stopAnimating];
  • 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-13T01:35:15+00:00Added an answer on June 13, 2026 at 1:35 am

    Since you are copying toolbar items to array, you might use [toolbarItems insertObject:refreshButton atIndex:0] instead of addObject.

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

Sidebar

Related Questions

I have a UIToolbar that I set up using IB with three buttons, left,
I have a UINavigationController that has a UIToolbar on the bottom. Several of my
I have a UIToolbar that needs three buttons in a radio style, meaning that
I am making an app that has an MKMapView. I have a translucent UIToolbar
I have a view that has a UISegmentedControl in its bottom UIToolBar with 2
The layout... I have a UIToolbar that loads a view with several buttons. One
I have view that has a webview and a UIToolbar. I want to create
I have an instance of UIToolbar that contains a UITextField inside. I'd like to
I have a UIViewController that contains a subview and a UIToolbar. I'm trying to
I have a UIToolbar where I have dragged a UIButton. When I set 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.