How to Show the Loading Indicator in the Top Status Bar

How to show the loading indicator in the top status bar

It's in UIApplication:

For Objective C:

Start:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

End:

[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

For swift :

Start

UIApplication.shared.isNetworkActivityIndicatorVisible = true

End

UIApplication.shared.isNetworkActivityIndicatorVisible = false

Loading Indicator in Status Bar iOS

I think what you are looking for is:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

Swift 3

UIApplication.shared.isNetworkActivityIndicatorVisible = true

as doc'd here:
https://developer.apple.com/documentation/uikit/uiapplication/1623102-isnetworkactivityindicatorvisibl

Best way to show a loading/progress indicator?

ProgressDialog is deprecated from Android Oreo. Use ProgressBar instead

ProgressDialog progress = new ProgressDialog(this);
progress.setTitle("Loading");
progress.setMessage("Wait while loading...");
progress.setCancelable(false); // disable dismiss by tapping outside of the dialog
progress.show();
// To dismiss the dialog
progress.dismiss();

OR

ProgressDialog.show(this, "Loading", "Wait while loading...");

Read more here.

By the way, Spinner has a different meaning in Android. (It's like the select dropdown in HTML)

How to show download progress beneath status bar

If your application uses default navigation bar then you can't able to show progress bar beneath the status bar as navigation bar position is default at top of the view. You cant change that. But if you want to show progress bar with navigation bar then you need to customized the navigation bar.

And if your application doesn't have navigation bar then you can directly use progress bar on top of the view so that it will appear exact below to the status bar. Hope this will help you.

How to set the activity indicator in the navigation bar?

I add the below piece of code in the view where i wanted the activity indicator in the navigation bar.

activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
UIBarButtonItem * barButton = [[UIBarButtonItem alloc] initWithCustomView:activityIndicator];
[self navigationItem].rightBarButtonItem = barButton;
[activityIndicator startAnimating];


Related Topics



Leave a reply



Submit