本文整理汇总了C#中UIAlertView.AddSubview方法的典型用法代码示例。如果您正苦于以下问题:C# UIAlertView.AddSubview方法的具体用法?C# UIAlertView.AddSubview怎么用?C# UIAlertView.AddSubview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIAlertView
的用法示例。
在下文中一共展示了UIAlertView.AddSubview方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidAppear
public override void ViewDidAppear(bool animated)
{
// if (_isLoaded)
// {
// DidRotate(new UIInterfaceOrientation());
// return;
// }
base.ViewDidAppear (animated);
AddComponents ();
Init ();
var lbl = new UILabel (new RectangleF(100,0,100,30));
lbl.Text = "Загрузка";
lbl.BackgroundColor = UIColor.FromRGBA (0, 0, 0, 0);
lbl.TextColor = UIColor.White;
var activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
activitySpinner.Frame = new RectangleF (0,-35,50,50);
activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
activitySpinner.StartAnimating ();
_alert = new UIAlertView();
_alert.Frame.Size = new SizeF (60, 60);
_alert.AddSubview(activitySpinner);
_alert.AddSubview (lbl);
_alert.Show();
_twitterConection.GeTwittstByTag(_tag, GetNumberOfRows());
_isSelected = false;
}
示例2: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
_client = new TwitterClient();
var loading = new UIAlertView("Downloading Tweets", "Please wait...", null, null, null);
loading.Show();
var indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
indicator.Center = new System.Drawing.PointF(loading.Bounds.Width / 2, loading.Bounds.Size.Height - 40);
indicator.StartAnimating();
loading.AddSubview (indicator);
_client.GetTweetsForUser ("OReillyMedia", tweets =>
{
InvokeOnMainThread(() =>
{
TableView.Source = new TwitterTableViewSource(tweets);
TableView.ReloadData();
loading.DismissWithClickedButtonIndex (0, true);
});
});
_client.MentionReceived += (object sender, MentionEventArgs args) =>
{
InvokeOnMainThread(() =>
new UIAlertView("Mention Received", args.Tweet.Text,
null, "Ok", null).Show());
};
}
示例3: CrearAlerta
private UIAlertView CrearAlerta()
{
// manejar inicio de sesion aqui.
String title = "Obteniendo lista de maestros";
String message = "Descargando lista de maestros";
// crear spinner
UIActivityIndicatorView spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
// Crea la intancia de alerta e inicializa sus valores
UIAlertView alerta = new UIAlertView (title, message, null, null, null);
alerta.Title = title;
alerta.Message = message;
alerta.Delegate = null;
// mostrar alerta siempre
alerta.Show ();
// le damos las coordenadas, lo agregamos y hechamos a andar
spinner.Center = new System.Drawing.PointF (alerta.Bounds.Size.Width / 2,
alerta.Bounds.Size.Height - 50);
alerta.AddSubview (spinner);
spinner.StartAnimating ();
return alerta;
}
示例4: CreateAlert
private void CreateAlert()
{
_alert = new UIAlertView(new RectangleF(10, 56, 300, 200));
_alert.AlertViewStyle = UIAlertViewStyle.Default;
_alert.Title = "HashBot";
_alert.Message = "Загрузка данных...";
var indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
indicator.Center = new PointF(139.5f, 100);
indicator.StartAnimating();
_alert.AddSubview(indicator);
}
示例5: Show
public static void Show(string title)
{
if(_alertView != null){
_alertView.Title = title;
return;
}
_alertView = new UIAlertView();
_alertView.Title = title;
_alertView.Show();
_activityView = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
_activityView.Frame = new RectangleF((_alertView.Bounds.Width / 2) - 15, _alertView.Bounds.Height - 50, 30, 30);
_activityView.StartAnimating();
_alertView.AddSubview(_activityView);
}
示例6: ViewDidAppear
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear (animated);
_client = new RemoteDataRepository (_baseUrl);
var loading = new UIAlertView ("Downloading Session", "Please wait...", null, null, null);
loading.Show ();
var indicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
indicator.Center = new System.Drawing.PointF (loading.Bounds.Width / 2, loading.Bounds.Size.Height - 40);
indicator.StartAnimating ();
loading.AddSubview (indicator);
_client.GetSession ("CodeMash-2012", this.SessionSlug, session =>
{
InvokeOnMainThread (() =>
{
//new UIAlertView ("Session", session.title, null, "Ok", null).Show ();
this.sessionTitleLabel.Text = session.title;
this.sessionEndLabel.Text = session.end.ToString ();
this.sessionStartLabel.Text = session.start.ToString();
this.sessionTwitterHashTagLabel.Text = session.twitterHashTag;
loading.DismissWithClickedButtonIndex (0, true);
}
);
}
);
// Perform any additional setup after loading the view, typically from a nib.
//this.TableView.Source = new DataSource (this);
// if (!UserInterfaceIdiomIsPhone) {
// this.TableView.SelectRow (
// NSIndexPath.FromRowSection (0, 0),
// false,
// UITableViewScrollPosition.Middle
// );
// }
}
示例7: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
var backgroundImage = UIImage.FromBundle(@"images/appview/bg");
//this.View.BackgroundColor = UIColor.FromPatternImage(backgroundImage);
_client = new RemoteDataRepository (_baseUrl);
var loading = new UIAlertView (" Downloading Speakers", "Please wait...", null, null, null);
loading.Show ();
var indicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
indicator.Center = new System.Drawing.PointF (loading.Bounds.Width / 2, loading.Bounds.Size.Height - 40);
indicator.StartAnimating ();
loading.AddSubview (indicator);
_client.GetSpeakers ("CodeMash-2012", speakers =>
{
InvokeOnMainThread (() =>
{
TableView.Source = new SpeakersTableViewSource (this, speakers);
TableView.ReloadData ();
loading.DismissWithClickedButtonIndex (0, true);
}
);
}
);
// Perform any additional setup after loading the view, typically from a nib.
//this.TableView.Source = new DataSource (this);
if (!UserInterfaceIdiomIsPhone)
this.TableView.SelectRow (
NSIndexPath.FromRowSection (0, 0),
false,
UITableViewScrollPosition.Middle
);
}
示例8: ShowAlertProgress
/// <summary>
/// Shows the alert progress dialog.
/// </summary>
/// <param name="title">The title.</param>
/// <param name="text">The text.</param>
public static void ShowAlertProgress(string title, string text)
{
UIApplication.SharedApplication.InvokeOnMainThread(
() =>
{
if (_alertView != null)
{
_alertView.DismissWithClickedButtonIndex(-1, true);
}
_alertView = new UIAlertView(title, text ?? string.Empty, null, null, null);
_alertView.Show();
var activityView =
new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge)
{
Frame = new RectangleF((_alertView.Bounds.Width / 2) - 15, _alertView.Bounds.Height - 60, 30, 30)
};
activityView.StartAnimating();
_alertView.AddSubview(activityView);
});
}
示例9: Show
public static void Show(string messageText)
{
var mb = new UIAlertView{Message = messageText};
var back = new UIImageView(new UIImage("Images/messageBoxBack.png"));
mb.Show();
mb.Subviews[0].Alpha = 0f;
var label = ((UILabel) mb.Subviews[1]);
label.TextColor = UIColor.DarkGray;
label.ShadowColor = UIColor.Clear;
back.Frame = new RectangleF(0,0,mb.Bounds.Width, mb.Bounds.Height);
back.Layer.CornerRadius = 15;
back.Layer.MasksToBounds = true;
back.Layer.BorderColor = UIColor.FromRGB(193,183,154).CGColor;
back.Layer.BorderWidth = 2f;
mb.AddSubview(back);
mb.SendSubviewToBack(back);
}
示例10: PromptForName
private void PromptForName(HandlerToUse handlerType)
{
UITextField tf = new UITextField (new System.Drawing.RectangleF (12f, 45f, 260f, 25f));
tf.BackgroundColor = UIColor.White;
tf.UserInteractionEnabled = true;
tf.AutocorrectionType = UITextAutocorrectionType.No;
tf.AutocapitalizationType = UITextAutocapitalizationType.None;
tf.ReturnKeyType = UIReturnKeyType.Done;
tf.SecureTextEntry = false; // Set this to true if you want a password-style text masking
UIAlertView myAlertView = new UIAlertView()
{
Title = "Please enter your name",
Message = "this is hidden"
};
myAlertView.AddButton("Cancel");
myAlertView.AddButton("Ok");
myAlertView.AddSubview(tf);
if (handlerType == HandlerToUse.Delegate)
{
myAlertView.Delegate = new MyAlertDelegate(this);
}
else
{
myAlertView.Clicked += HandleMyAlertViewClicked;
}
myAlertView.Transform = MonoTouch.CoreGraphics.CGAffineTransform.MakeTranslation (0f, 110f);
myAlertView.Show ();
}
示例11: CrearAlerta
private void CrearAlerta()
{
// manejar inicio de sesion aqui.
String title = "Validando alumno";
String message = "Estamos validando el ID y NIP, esperanos un poco...";
// crear spinner
UIActivityIndicatorView spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
// Crea la intancia de alerta e inicializa sus valores
this.mAlert = new UIAlertView (title, message, null, null, null);
this.mAlert.Title = title;
this.mAlert.Message = message;
this.mAlert.Delegate = null;
// mostrar alerta siempre
this.mAlert.Show ();
// le damos las coordenadas, lo agregamos y hechamos a andar
spinner.Center = new System.Drawing.PointF (mAlert.Bounds.Size.Width / 2,
mAlert.Bounds.Size.Height - 50);
mAlert.AddSubview (spinner);
spinner.StartAnimating ();
}
示例12: Show
/// <inheritdoc />
public override void Show(string caption, object content, ButtonConfig[] buttonConfigs, bool isFullScreen = false)
{
Guard.ArgumentNotNull(() => buttonConfigs);
var stringContent = content as string;
if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
{
var alertController = UIAlertController.Create(caption, string.Empty, UIAlertControllerStyle.Alert);
if (stringContent != null)
{
alertController.Message = stringContent;
}
var view = content as UIView;
if (view != null)
{
UIViewController v = new UIViewController();
v.View = view;
alertController.SetValueForKey(v, new NSString("contentViewController"));
//alertController.View.AddSubview(view);
}
foreach (var buttonConfig in buttonConfigs)
{
var alertAction = UIAlertAction.Create(buttonConfig.Text, UIAlertActionStyle.Default, x => buttonConfig.Action());
EventHandler<bool> buttonConfigOnEnabledChanged = null;
buttonConfigOnEnabledChanged = (sender, isEnabled) => { alertAction.Enabled = isEnabled; };
buttonConfig.EnabledChanged += buttonConfigOnEnabledChanged;
alertAction.Enabled = buttonConfig.IsEnabled;
alertController.AddAction(alertAction);
}
this.dispatcherService.CheckBeginInvokeOnUI(() => { UIApplication.SharedApplication.PresentInternal(alertController); });
}
else
{
var alertView = new UIAlertView
{
AlertViewStyle = UIAlertViewStyle.Default,
Title = caption
};
if (stringContent != null)
{
alertView.Message = stringContent;
}
var view = content as UIView;
if (view != null)
{
alertView.AddSubview(view);
}
foreach (var buttonConfig in buttonConfigs)
{
alertView.AddButton(buttonConfig.Text);
}
alertView.Clicked += (s, e) => { buttonConfigs[e.ButtonIndex].Action(); };
this.dispatcherService.CheckBeginInvokeOnUI(() => { alertView.Show(); });
}
}
示例13: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
var backgroundImage = UIImage.FromBundle(@"images/appview/bg");
//this.View.BackgroundColor = UIColor.FromPatternImage(backgroundImage);
_client = new RemoteDataRepository (_baseUrl);
var loading = new UIAlertView (" Downloading Sessions", "Please wait...", null, null, null);
loading.Show ();
var indicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
indicator.Center = new System.Drawing.PointF (loading.Bounds.Width / 2, loading.Bounds.Size.Height - 40);
indicator.StartAnimating ();
loading.AddSubview (indicator);
// _client.GetFullConference("CodeMash-2012", conference => {
// var connectionString = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments), "conferences.db");
// var localDatabase = new LocalDatabase(connectionString);
// localDatabase.CreateDatabase();
//
// var conferenceMapper = new ConferenceDtoToConferenceEntityMapper();
// var conferenceEntity = conferenceMapper.Map(conference);
//
// var sessionMapper = new SessionDtoToSessionEntityMapper();
// var sessions = sessionMapper.MapAll(conferenceEntity.Id, conference.sessions.AsEnumerable());
// //localDatabase.SaveSessions(sessions);
//
// var speakersMapper = new SessionDtoToSessionEntityMapper();
// var speakerEntities = speakersMapper.MapAll(conferenceEntity.Id, conference.speakers.AsEnumerable());
// localDatabase.SaveConference(conferenceEntity, sessions, speakers);
//
// });
_client.GetSessions ("CodeMash-2012", sessions =>
{
InvokeOnMainThread (() =>
{
TableView.Source = new SessionsTableViewSource (this, sessions);
TableView.ReloadData ();
loading.DismissWithClickedButtonIndex (0, true);
});
}
);
// Perform any additional setup after loading the view, typically from a nib.
//this.TableView.Source = new DataSource (this);
if (!UserInterfaceIdiomIsPhone)
this.TableView.SelectRow (
NSIndexPath.FromRowSection (0, 0),
false,
UITableViewScrollPosition.Middle
);
}