Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Big activity indicator on iPhone

Does anyone know how to show a rounded squared with a spinning activity indicator? It is used in many apps. If you don't know what im talking about, it looks like the indicator when you change volume on your Mac but with a darker background. Im not sure if it is built-in to iOS or someone made it.

Like the one in this post but not full screen just the activity indicator How to create a full-screen modal status display on iPhone?

like image 396
Yazzmi Avatar asked Aug 16 '10 06:08

Yazzmi


People also ask

What is Activity Indicator In iOS?

An Activity Indicator is a spinning wheel that indicates a task is being processed. if an action takes an unknown amount of time to process you should display an activity indicator to let the user know your app is not frozen.

What is Activity Indicator?

Activity indicator is used to present progress of some activity in the app. It can be used as a drop-in for the ActivityIndicator shipped with React Native.

What is an indicator of progress?

Alternatively referred to as a progress bar, a progress indicator is a graphical representation of the current status of a task. It is helpful for estimating the amount of time before a task is completed.


1 Answers

Here's what I use when I want to show that kind of indicators.

UIView *loading = [[UIView alloc] initWithFrame:CGRectMake(100, 200, 120, 120)]; 

loading.layer.cornerRadius = 15;
loading.opaque = NO;
loading.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.6f];

UILabel *loadLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 25, 81, 22)];

loadLabel.text = @"Loading";
loadLabel.font = [UIFont boldSystemFontOfSize:18.0f];
loadLabel.textAlignment = UITextAlignmentCenter;
loadLabel.textColor = [UIColor colorWithWhite:1.0f alpha:1.0f];
loadLabel.backgroundColor = [UIColor clearColor];

[loading addSubview:loadLabel];
[loadLabel release];

UIActivityIndicatorView *spinning = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinning.frame = CGRectMake(42, 54, 37, 37);
[spinning startAnimating];

[loading addSubview:spinning];
[spinning release];

loading.frame = CGRectMake(100, 200, 120, 120);

Then you just add the 'loading' view to the view of your choice and you got it.

Hope this is what you needed.

like image 83
guirto Avatar answered Nov 15 '22 12:11

guirto