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
Flutter on iOS: Fatal Error: Module 'Cloud_Firestore' Not Found
How Reliable Is Kvo with Uikit
How to Use Unsafemutablepointer in Swift 3
How to Set an Nscalendarunitminute Repeatinterval on iOS 10 Usernotifications
Nsgenericexception Reason Collection <Nsconcretemaptable: Xxx>
Uiimagejpegrepresentation Received Memory Warning
Calling Performseguewithidentifier Doesn't Call Shouldperformseguewithidentifier
How to Determine Which Textfield Is Active Swift
How to Use Objective-C Code with #Define MACros in Swift
How to Pass Information Between Storyboard Segues
How to Scroll to a Particluar Index in Collection View in Swift
Customize Apps Gallery in Appstore Page
Ipa Generated by Swift Is So Big, About 5Mb
How to Do Indexofobject or a Proper Containsobject
How to Do Weak Linking in Swift
Flutter: Cocoapods's Specs Repository Is Too Out-Of-Date to Satisfy Dependencies