Skip to content

Instantly share code, notes, and snippets.

@aspnetde
Last active December 19, 2015 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspnetde/5894488 to your computer and use it in GitHub Desktop.
Save aspnetde/5894488 to your computer and use it in GitHub Desktop.
Calling the Show()-Method within ViewDidLoad() works, it event works when calling it within the first tap-handler of the StringElement. But calling it in the click-handler of the alert view, it disappears.
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
using BigTed;
namespace iOS.ProgressHUD.Demo
{
public partial class Demo : DialogViewController
{
public Demo() : base (UITableViewStyle.Grouped, null)
{
Root = new RootElement("Demo")
{
new Section ("Demo"){
new StringElement ("Show Spinner", () => {
var alert = new UIAlertView(
"Type something in",
"Foo",
null,
"Cancel",
"Show me the HUD"
);
alert.Clicked += ShowHUD;
alert.Show();
}),
}
};
}
void ShowHUD(object sender, UIButtonEventArgs e)
{
if (e.ButtonIndex == 0)
return;
BTProgressHUD.Show("Hello World ... this should not disappear ...");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment