本文整理汇总了C#中UIActionSheet.Add方法的典型用法代码示例。如果您正苦于以下问题:C# UIActionSheet.Add方法的具体用法?C# UIActionSheet.Add怎么用?C# UIActionSheet.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIActionSheet
的用法示例。
在下文中一共展示了UIActionSheet.Add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActionSheetPicker
/// <summary>
///
/// </summary>
public ActionSheetPicker(UIView owner)
{
// save our uiview owner
this._owner = owner;
// configure the title label
titleLabel.BackgroundColor = UIColor.Clear;
titleLabel.TextColor = UIColor.LightTextColor;
titleLabel.Font = UIFont.BoldSystemFontOfSize (18);
// create + configure the action sheet
_actionSheet = new UIActionSheet () { Style = UIActionSheetStyle.BlackTranslucent };
_actionSheet.Clicked += (s, e) => { Console.WriteLine ("Clicked on item {0}", e.ButtonIndex); };
// add our controls to the action sheet
_actionSheet.AddSubview (picker);
_actionSheet.AddSubview (titleLabel);
//actionSheet.AddSubview (doneButton);
// Add the toolbar
_toolbar = new UIToolbar(new RectangleF(0, 0, _actionSheet.Frame.Width, 10));
_toolbar.BarStyle = UIBarStyle.Black;
_toolbar.Translucent = true;
// Add the done button
_doneButton = new UIBarButtonItem("Aceptar",UIBarButtonItemStyle.Done, null);
_doneButton.Clicked += (object sender, EventArgs e) => {
_actionSheet.DismissWithClickedButtonIndex (0, true);
};
_toolbar.Items = new UIBarButtonItem[] {
new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace, null, null),
_doneButton
};
_toolbar.SizeToFit();
_actionSheet.Add (_toolbar);
}
示例2: HandleMoveButtonCellTapped
void HandleMoveButtonCellTapped(UITableView tableView)
{
if (selectedVerses != null && selectedVerses.Count != 0)
{
var actionSheetDelegate = new MoveActionSheetDelegate(tableViewController, data, selectedVerses);
var actionSheet = new UIActionSheet
{
CancelButtonIndex = 9,
Delegate = actionSheetDelegate,
Title = "Move"
};
actionSheet.Add("Sunday");
actionSheet.Add("Monday");
actionSheet.Add("Tuesday");
actionSheet.Add("Wednesday");
actionSheet.Add("Thursday");
actionSheet.Add("Friday");
actionSheet.Add("Saturday");
actionSheet.Add("Queue");
actionSheet.Add("Review");
actionSheet.Add("Cancel");
actionSheet.ShowFromTabBar(AppDelegate.TabBarController.TabBar);
selected = new bool[data.Count];
}
else
{
new UIAlertView("No Selected Verses", "Whoops! Select the verses you wish to move first!", null, "Okay", null).Show();
}
}
示例3: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
difficulties = new Dictionary<int, EDifficulty>();
languages = new Dictionary<int, EGameLanguage>();
#region difficulty picker
actionDifficulty = new UIActionSheet();
actionDifficulty.Title = "Selecteer de moeilijkheidsgraad";
int index = 0;
foreach (var item in Enum.GetValues(typeof(EDifficulty)))
{
if ((EDifficulty)item != EDifficulty.Custom && (EDifficulty)item != EDifficulty.None)
{
difficulties.Add(index, (EDifficulty)item);
actionDifficulty.Add(item.ToString());
index++;
}
}
actionDifficulty.Add("Annuleer");
actionDifficulty.Clicked += (sender1, e1) =>
{
if (e1.ButtonIndex != actionDifficulty.ButtonCount - 1)
{
GlobalSupport.GameDifficulty = difficulties[(int)e1.ButtonIndex];
UpdateGUI();
UpdateTableView();
}
};
#endregion
#region language picker
actionLanguage = new UIActionSheet();
actionLanguage.Title = "Selecteer de programmeertaal";
index = 0;
foreach (var item in Enum.GetValues(typeof(EGameLanguage)))
{
if ((EGameLanguage)item != EGameLanguage.None)
{
languages.Add(index, (EGameLanguage)item);
actionLanguage.Add(item.ToString());
index++;
}
}
actionLanguage.Add("Annuleer");
actionLanguage.Clicked += (sender1, e1) =>
{
if (e1.ButtonIndex != actionLanguage.ButtonCount - 1)
{
GlobalSupport.GameLanguage = (EGameLanguage)(languages[(int)e1.ButtonIndex]);
UpdateGUI();
}
};
#endregion
btnDifficulty.TouchUpInside += (object sender, EventArgs e) =>
{
actionDifficulty.ShowInView(scrollView);
GlobalSupport.GameDifficulty = EDifficulty.None;
GlobalSupport.GameLevel = "";
};
btnLanguage.TouchUpInside += (object sender, EventArgs e) =>
{
actionLanguage.ShowInView(scrollView);
};
btnStart.TouchUpInside += (object sender, EventArgs e) =>
{
if (GlobalSupport.GameDifficulty != EDifficulty.Custom && GlobalSupport.GameDifficulty != EDifficulty.None)
{
if (GlobalSupport.GameLanguage != EGameLanguage.None)
{
if (!String.IsNullOrEmpty(GlobalSupport.GameLevel))
{
GlobalSupport.EverythingOkay = true;
}
else
{
GlobalSupport.ShowPopupMessage("Selecteer een level");
GlobalSupport.EverythingOkay = false;
}
//.........这里部分代码省略.........
示例4: DeleteCode
public void DeleteCode()
{
UIActionSheet actionSheet = new UIActionSheet("Selecteer Code");
foreach (var item in codeDatabase.SelectAll<Code> ().Where (GlobalSupport.OpenCodeQuery).ToList())
{
actionSheet.Add(String.Format("{0} {1} {2}",item.ID,item.FileName,item.Author));
}
actionSheet.Add("Annuleer");
actionSheet.Clicked += (sender, e) =>
{
if (e.ButtonIndex != actionSheet.ButtonCount - 1)
{
codeDatabase.DeleteById<Code>(Convert.ToInt32(actionSheet.ButtonTitle(e.ButtonIndex).Split(' ')[0]));
}
};
actionSheet.CancelButtonIndex = actionSheet.ButtonCount;
actionSheet.ShowInView(this.View);
}
示例5: OpenCode
public void OpenCode()
{
UIActionSheet actionSheet = new UIActionSheet("Selecteer Code");
Dictionary<int, int> codeIDDictionary = new Dictionary<int, int>();
foreach (var item in codeDatabase.SelectAll<Code> ().Where (GlobalSupport.OpenCodeQuery).ToList())
{
codeIDDictionary.Add((int)actionSheet.ButtonCount, item.ID);
actionSheet.Add(String.Format("{0} {1} {2}",item.ID,item.FileName,item.Author));
}
actionSheet.Clicked += (sender, e) =>
{
if (e.ButtonIndex != actionSheet.ButtonCount - 1)
{
ResetCode(true);
txtCodeField.Text = codeDatabase.SelectById<Code>(codeIDDictionary[(int)e.ButtonIndex]).CodeString.ToString();
}
};
actionSheet.AddButton ("Cancel");
actionSheet.CancelButtonIndex = actionSheet.ButtonCount;
actionSheet.ShowInView(this.View);
}
示例6: HandleEditButtonTapped
private void HandleEditButtonTapped(object sender, EventArgs args)
{
var actionSheetDelegate = new VerseEditActionSheetDelegate (this, verse);
var actionSheet = new UIActionSheet {
CancelButtonIndex = 2,
DestructiveButtonIndex = 0,
Delegate = actionSheetDelegate,
};
actionSheet.Add ("Delete");
actionSheet.Add ("Edit");
actionSheet.Add ("Cancel");
actionSheet.ShowFromTabBar (AppDelegate.TabBarController.TabBar);
}
示例7: ActionSheetDatePickerCustom
public ActionSheetDatePickerCustom (UIView owner)
{
picker = new UIDatePicker (CGRect.Empty);
// save our uiview owner
this._owner = owner;
// create + configure the action sheet
_actionSheet = new UIActionSheet () { Style = UIActionSheetStyle.BlackTranslucent };
_actionSheet.Clicked += (s, e) => {
Console.WriteLine ("Clicked on item {0}", e.ButtonIndex);
};
// configure the title label
titleLabel = new UILabel (new CGRect (0, 0, _actionSheet.Frame.Width, 10));
titleLabel.BackgroundColor = UIColor.Clear;
titleLabel.TextColor = UIColor.Black;
titleLabel.Font = UIFont.BoldSystemFontOfSize (18);
// Add the toolbar
_toolbar = new UIToolbar (new CGRect (0, 0, _actionSheet.Frame.Width, 10));
_toolbar.BarStyle = UIBarStyle.Default;
_toolbar.Translucent = true;
// Add the done button
_doneButton = new UIBarButtonItem ("Gereed", UIBarButtonItemStyle.Done, null);
_toolbar.Items = new UIBarButtonItem[] {
new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace, null, null),
_doneButton
};
_toolbar.SizeToFit ();
_actionSheet.AddSubview (picker);
_actionSheet.Add (_toolbar);
_actionSheet.AddSubview (titleLabel);
}
示例8: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
selectedDifficulty = EDifficulty.Easy;
#region select difficulty
difficulties = new Dictionary<int, EDifficulty>();
actionDifficulty = new UIActionSheet();
actionDifficulty.Title = "Selecteer de moeilijkheidsgraad";
int index = 0;
foreach (var item in Enum.GetValues(typeof(EDifficulty)))
{
if ((EDifficulty)item != EDifficulty.Custom && (EDifficulty)item != EDifficulty.None)
{
difficulties.Add(index, (EDifficulty)item);
actionDifficulty.Add(item.ToString());
index++;
}
}
actionDifficulty.Add("Annuleer");
actionDifficulty.Clicked += (sender1, e1) =>
{
if (e1.ButtonIndex != actionDifficulty.ButtonCount - 1)
{
selectedDifficulty = difficulties[(int)e1.ButtonIndex];
UpdateTableView();
}
};
#endregion
btnDifficulty.TouchUpInside += (object sender, EventArgs e) =>
{
actionDifficulty.ShowInView(scrollView);
};
}
示例9: ViewWillAppear
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
if (this.ParentViewController.NavigationController != null)
{
var aButton = new UIBarButtonItem (UIBarButtonSystemItem.Action);
aButton.Clicked += (object sender, EventArgs e) => {
var alert = new UIActionSheet ("Themes");
alert.AddButton ("Default");
alert.AddButton ("New");
alert.AddButton ("iTunes");
alert.AddButton ("Cancel");
alert.CancelButtonIndex = 3;
alert.Clicked += (object action, UIButtonEventArgs e2) => {
DSGridTheme newtheme = null;
switch (e2.ButtonIndex)
{
case 0:
{
//Use default
newtheme = new DSGridDefaultTheme ();
}
break;
case 1:
{
//Create a theme progratically
newtheme = new DSGridDefaultTheme () {
HeaderStyle = GridHeaderStyle.Standard,
HeaderHeight = 75.0f,
CellBackground = DSColor.Black,
CellBackground2 = DSColor.Black,
CellTextForeground = DSColor.White,
CellTextForeground2 = DSColor.White,
CellBackgroundHighlight = DSColor.Gray,
CellTextHighlight = DSColor.Red,
};
}
break;
case 2:
{
//Use subclass
newtheme = new ItunesTheme ();
}
break;
}
if (newtheme != null)
{
//set the current theme - grid will reload
DSGridTheme.Current = newtheme;
//reload the grid
//GridView.ReloadData ();
}
};
alert.ShowFrom ((UIBarButtonItem)sender, true);
};
var aButton2 = new UIBarButtonItem (UIBarButtonSystemItem.Action);
aButton2.Clicked += (object sender, EventArgs e) => {
var alert = new UIActionSheet ("Scroll To: 30");
alert.AddButton ("Top");
alert.AddButton ("Middle");
alert.AddButton ("Bottom");
alert.AddButton ("Cancel");
alert.CancelButtonIndex = 3;
alert.Clicked += (object action, UIButtonEventArgs e2) => {
switch (e2.ButtonIndex)
{
case 0:
{
//top
this.GridView.SelectRow (30, Mode: ScrollToMode.Top);
}
break;
case 1:
{
//Middle
this.GridView.SelectRow (30, Mode: ScrollToMode.Middle, AdditonalOffset: 54.0f);
}
break;
case 2:
{
//Bottom
this.GridView.SelectRow (30, Mode: ScrollToMode.Bottom, AdditonalOffset: 54.0f);
}
break;
}
};
alert.ShowFrom ((UIBarButtonItem)sender, true);
//.........这里部分代码省略.........