Skip to content

Instantly share code, notes, and snippets.

@therealjohn
Last active December 26, 2015 10:39
Show Gist options
  • Save therealjohn/7138336 to your computer and use it in GitHub Desktop.
Save therealjohn/7138336 to your computer and use it in GitHub Desktop.
BTProgressHUD issue.
// Same results in all the ViewDidLoad, Appear, WillAppear, etc.
// The "Loading" dialog only shows for ~2ish seconds, then disappears. It disappears before the Dismiss();
public override void LoadView ()
{
base.LoadView ();
BTProgressHUD.Show("Loading");
try {
LoadSomething().ContinueWith(task => { // 10 Second task
var something = task.Result;
CreateRoot();
BTProgressHUD.Dismiss();
});
} catch (Exception ex) {
BTProgressHUD.Dismiss();
}
}
// Same results
public override async void LoadView ()
{
base.LoadView ();
BTProgressHUD.Show("Loading"); // This is shown. Then 2ish seconds later its gone.
// Screen is blank, then the CreateRoot happens and the screen loads fine and all is good except that the loading dissapears before the CreateRoot is finished.
try {
var something = await LoadSomething();
CreateRoot();
BTProgressHUD.Dismiss();
} catch (Exception ex) {
// No exception is happening.
BTProgressHUD.Dismiss();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment