private void DismissMessage() { if (alert != null) { alert.Hide(); } if (alertDelay != null) { alertDelay.Dispose(); } alert = null; alertDelay = null; }
public void MakeText(string text) { if (alert != null) { DismissMessage(); } if (alertDelay != null) { DismissMessage(); } alertDelay = NSTimer.CreateScheduledTimer(3.5, (obj) => DismissMessage()); var bounds = UIScreen.MainScreen.Bounds; alert = new ToastView(bounds, text); UIApplication.SharedApplication.KeyWindow.Add(alert); }