コード例 #1
0
        private void DismissMessage()
        {
            if (alert != null)
            {
                alert.Hide();
            }

            if (alertDelay != null)
            {
                alertDelay.Dispose();
            }

            alert      = null;
            alertDelay = null;
        }
コード例 #2
0
        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);
        }