In my iOS project, the page has a list view which takes some time to load. I want to display the loading squiggly as shown here but it is disabling the whole page until it loads up. I want to let the user go back using the navigation button if they want to during the loading process.
The code I am using now is:
var bounds = UIScreen.MainScreen.Bounds;
loadPop = new LoadingOverlay (bounds);
It´s very simple actually. You just need to add a view (with the spinner) on top of the list and hide it manually when data is loaded.
If you still want to use that
LoadingOverlay sample, modify the bounds argument:
var navigationBarHeight = 48; // not sure what´s the actual height. Google it! var bounds = UIScreen.MainScreen.Bounds; loadPop = new LoadingOverlay (new CGRect(bounds.X, navigationBarHeight, bounds.Width, bounds.Height - navigationBarHeight); View.Add (loadPop);
If you just need the spinner, you can also take some code from the link your provided:
activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge); // change color here activitySpinner.Frame = new CGRect ( centerX - (activitySpinner.Frame.Width / 2) , centerY - activitySpinner.Frame.Height - 20 , activitySpinner.Frame.Width, activitySpinner.Frame.Height); activitySpinner.AutoresizingMask = UIViewAutoresizing.All; AddSubview (activitySpinner); activitySpinner.StartAnimating ();