-4

In a lot of apps I use, I see this UI Activity Indicator View? Is it made manually, or does apple have a SDK for it? I know how to make the normal one, but how do I access the one with a black background?

enter image description here

Thanks

1
  • The title of this question is so generic and could be made much more specific. Commented Apr 8, 2015 at 13:29

3 Answers 3

0

You already know that it's a UIActivityIndicatorView.

You can drop it into your view in a Storyboard or XIB file, or you can add it programatically. It's part of the iOS SDK.

To change the style, there are UIActivityIndicatorStyles you can set when calling 'initWithActivityIndicatorStyle:' programatically or in the attribute section of your storyboard/xib file.

Sign up to request clarification or add additional context in comments.

Comments

0

I think it's a custom spinner, created with MBProgressHUD.

MBProgressHUD is an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, private UIKit UIProgressHUD with some additional features.

A basic use:

[MBProgressHUD showHUDAddedTo:self.view animated:YES]; dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ // do your stuff while spinner is showing dispatch_async(dispatch_get_main_queue(), ^{ [MBProgressHUD hideHUDForView:self.view animated:YES]; // stop the spinner }); }); 

For use this in Swift see this answer.

Comments

-2

it's the UIActivityIndicatorView provided by iOS SDK, and we can set background color of UIActivityIndicatorView

UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; spinner.backgroundColor = [UIColor grayColor]; 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.