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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:43:04+00:00 2026-06-03T13:43:04+00:00

I have found a great article how to add an Activity Indicator inside Bar

  • 0

I have found a great article how to add an Activity Indicator inside Bar Button on Navigation Bar. But I cannot repeat this in my case. I have added both Navigation Bar and UIBarButton in code (not in nib) but I could not find an element named UINavigationButton to put Activity Indicator inside.

I want that UIBarButtonItem button is visible:

enter image description here

And not like that:

enter image description here

Does anyone have a suggestion how to make this work?

  • 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-03T13:43:05+00:00Added an answer on June 3, 2026 at 1:43 pm

    A rough work-around could be something like this:

     act=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
     [act setFrame:CGRectMake(14, 5, 20, 20)];
     [act startAnimating];
     rightButt=[[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleBordered target:self action:nil];
     self.navigationItem.rightBarButtonItem=rightButt;
     if ([[self.navigationController.navigationBar subviews] count]>=2) {
         //Be careful with the next line, Here you get access to an static index, 
         //Apple could change the structure of the navbar and your index may change in the future.
         [[[self.navigationController.navigationBar subviews] objectAtIndex:2] addSubview:act];    
    
        }
    

    And you’ll get this:

    enter image description here

    EDIT:
    From your comment it seems that you want to add this button inside UIToolbar, not in a UINavigationBar, it’s pretty the same:

    UIActivityIndicatorView* act=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    [act setFrame:CGRectMake(10, 13, 20, 20)];
    [act startAnimating];
    UIBarButtonItem *rightButt=[[UIBarButtonItem alloc] initWithTitle:@"      " style:UIBarButtonItemStyleBordered target:self action:nil];
    UIToolbar *tb=[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
    [tb setBarStyle:UIBarStyleBlack];
    [tb setItems:[NSArray arrayWithObjects:rightButt, nil]];
    if ([[tb subviews] count]>=1) {
        [[[tb subviews] objectAtIndex:1] addSubview:act];      
    }
    

    and you’ll get this:

    enter image description here

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

Sidebar

Related Questions

To this day, I have not found a great article about expressions - and
I have just found this great tutorial as it is something that I need.
I have found some great ways to check for where the scroll bar is
I have done some research prior to and have found some great articles but
I have found a great plugin that sets Facebook comments on an article where
I have adapted some code from a great article I found about circle drawing
I have problem with text drawing around Circle. I found great sample in C#
I have found this code to watch for a CD to be inserted/ejected using
I have found a lot of sites that can store my data but I
I have found some topics on templates and methods. But I can't figure out

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.