Is it possible to send a message to a UIAlterview as if it were a manual
button press? I learned this nice little trick of arresting program flow
until the cancel button was clicked. This works very nicely. However, I have
tried lots of other means to close this view but have been unsuccessful.
Actually my real need for this is to show an alertview for several seconds
then close it down after a fixed interval. I have tried timers and various
other mechanisms but nothing seems to work for me. I have probably missed
some very simple technique that the rest of the world knows about and I
don't. I would be most grateful for advice that anyone can give on this
topic. - Thanks.
string cancelButton = "Ok";
alert = new UIAlertView(caption, messageBoxText, null, cancelButton,
null);
alert.BackgroundColor = UIColor.FromWhiteAlpha(0f, 0.8f);
alert.Canceled += (sender, e) => {
buttonClicked = 0;
IsDisplayed = false;
};
alert.Show();
IsDisplayed = true;
while (IsDisplayed)
{
NSRunLoop.Current.RunUntil (NSDate.FromTimeIntervalSinceNow
(0.2));
}
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/Programmatically-induce-a-cancel-or-ok-for-a-UIAlertView-tp4655123.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch