Loading screen is not always displayed

swizzyswizzy CHMember ✭✭
edited July 2017 in Xamarin.iOS

Hi

At the moment I have the problem that the loading screen is not always displayed.
For the logic menu, I create a class. For switch between storyboards i only move in the z axis.

The loading screen only shows a picture with an activity spinner.

My Code:

var loadingOverlay = new LoadingOverlay(UIScreen.MainScreen.Bounds);
View.Add(loadingOverlay);
Task.Factory.StartNew(() =>
{
//Do nothing  but contunue with
}).ContinueWith(task => InvokeOnMainThread(() => {

MenuLogic menu = new MenuLogic();
menu.Menue(strMenuSeleted);
loadingOverlay.Hide();
}));

//in the MenuLogic Class:
//instance the Storyboard and make visible:
AppDelegate.Self.windowProducts.MakeKeyAndVisible();
//set the Z axis of this window to foreground:
AppDelegate.Self.setWindowZIndex("products");

The overlay is added to the screen with View.Add (loadingOverlay). If menu.Menue (strMenuSeleted) has passed, the overlay is removed with loadingOverlay.Hide()

Does anyone know why the load screen is sometimes embedded and sometimes not?

Sign In or Register to comment.