public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.White; var btnShowMessage = UIButton.FromType(UIButtonType.RoundedRect); btnShowMessage.Frame = new RectangleF(20, 20, 280, 44); btnShowMessage.SetTitle("Show Message", UIControlState.Normal); btnShowMessage.TouchUpInside += (sender, e) => { // Show a status Update StatusBar.ShowStatus("Status Update"); }; View.AddSubview(btnShowMessage); var btnIndeterminate = UIButton.FromType(UIButtonType.RoundedRect); btnIndeterminate.Frame = new RectangleF(20, 71, 280, 44); btnIndeterminate.SetTitle("Show Indeterminate Status", UIControlState.Normal); btnIndeterminate.TouchUpInside += (sender, e) => { // Show an indeterminate Activity status StatusBar.ShowActivity("Processing..."); }; View.AddSubview(btnIndeterminate); var btnDismiss = UIButton.FromType(UIButtonType.RoundedRect); btnDismiss.Frame = new RectangleF(20, 122, 280, 44); btnDismiss.SetTitle("Dismiss", UIControlState.Normal); btnDismiss.TouchUpInside += (sender, e) => { // Dismiss status bar StatusBar.Dismiss(); }; View.AddSubview(btnDismiss); var btnShowSuccess = UIButton.FromType(UIButtonType.RoundedRect); btnShowSuccess.Frame = new RectangleF(20, 173, 280, 44); btnShowSuccess.SetTitle("Show Success", UIControlState.Normal); btnShowSuccess.TouchUpInside += (sender, e) => { // Show Success Activity status StatusBar.ShowSuccess("Task Success"); }; View.AddSubview(btnShowSuccess); var btnShowError = UIButton.FromType(UIButtonType.RoundedRect); btnShowError.Frame = new RectangleF(20, 224, 280, 44); btnShowError.SetTitle("Show Error", UIControlState.Normal); btnShowError.TouchUpInside += (sender, e) => { // Show a failed Activity status StatusBar.ShowError("Task Failed"); }; View.AddSubview(btnShowError); }
public override void ViewDidLoad() { base.ViewDidLoad(); View.BackgroundColor = UIColor.White; var btnSuccess = UIButton.FromType(UIButtonType.RoundedRect); btnSuccess.Frame = new RectangleF(20, 20, 118, 44); btnSuccess.SetTitle("Show Success", UIControlState.Normal); // Set Success button to show StatusBar Success when tapped. btnSuccess.TouchUpInside += (o, e) => StatusBar.ShowSuccess("Loading succeeded!"); var btnError = UIButton.FromType(UIButtonType.RoundedRect); btnError.Frame = new RectangleF(182, 20, 118, 44); btnError.SetTitle("Show Error", UIControlState.Normal); // Set Error button to show StatusBar Error when tapped. btnError.TouchUpInside += (o, e) => StatusBar.ShowError("Loading Failed!"); var btnShowSatus = UIButton.FromType(UIButtonType.RoundedRect); btnShowSatus.Frame = new RectangleF(124, 71, 73, 44); btnShowSatus.SetTitle("Show", UIControlState.Normal); // Set Show button to show StatusBar status when tapped. btnShowSatus.TouchUpInside += (o, e) => StatusBar.ShowStatus("Loading..."); var btnDismiss = UIButton.FromType(UIButtonType.RoundedRect); btnDismiss.Frame = new RectangleF(124, 122, 73, 44); btnDismiss.SetTitle("Dismiss", UIControlState.Normal); // Set Dismiss button to dismiss StatusBar when tapped. btnDismiss.TouchUpInside += (o, e) => StatusBar.Dismiss(); View.AddSubviews(new [] { btnSuccess, btnError, btnShowSatus, btnDismiss }); }