Ejemplo n.º 1
0
        public void ShowToast(string message, int timeoutMs = 1500)
        {
            UIWindow window = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window;

            UIApplication.SharedApplication.InvokeOnMainThread(() =>
            {
                MBProgressHUD hud = MBProgressHUD.ShowHUDAddedTo(window, true);

                hud.Mode = MBProgressHUDMode.Text;
                hud.DetailsLabel.Text         = message;
                hud.RemoveFromSuperViewOnHide = true;
                hud.Margin = 10f;

                hud.BezelView.BackgroundColor = UIColor.Black;
                hud.DetailsLabel.TextColor    = UIColor.White;

                hud.HideAnimated(true, timeoutMs * 1.0 / 1000);
            });
        }