本文整理汇总了C#中UIActionSheet.ShowInView方法的典型用法代码示例。如果您正苦于以下问题:C# UIActionSheet.ShowInView方法的具体用法?C# UIActionSheet.ShowInView怎么用?C# UIActionSheet.ShowInView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIActionSheet
的用法示例。
在下文中一共展示了UIActionSheet.ShowInView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleBtnSimpleActionSheetTouchUpInside
void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
{
// create an action sheet using the qualified constructor
actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
actionSheet.Clicked += OnClicked;
actionSheet.ShowInView (View);
}
示例2: HandleBtActionClicked
void HandleBtActionClicked (object sender, EventArgs e)
{
var actionSheet = new UIActionSheet("") {"Del på facebook", "Send link på e-post", Utils.Translate("cancel")};
actionSheet.Title = "Del denne siden";
//actionSheet.DestructiveButtonIndex = 0;
actionSheet.CancelButtonIndex = 2;
actionSheet.ShowInView(this.View);
actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt)
{
switch (evt.ButtonIndex)
{
case 0:
//Del på facebook
break;
case 1:
//Send link på e-post
var url = webView.Request.MainDocumentURL;
var htmlstr ="<a href='"+url+"'>"+url+"</a>";
var reportScreen = new ReportJakt(htmlstr);
this.NavigationController.PushViewController(reportScreen, true);
break;
/*case 2:
//Del på face
MessageBox.Show("Ennå ikke implementert...", "");
break;
*/default:
//Avbryt
break;
}
};
}
示例3: CreateTilesPopUp
public void CreateTilesPopUp()
{
UIActionSheet actionsheet = new UIActionSheet("Selecteer een categorie"){ "Map", "Road", "Shop", "Annuleer" };
actionsheet.Clicked += (sender, e) =>
{
switch (e.ButtonIndex)
{
case 0:
GlobalSupport.MessageIdentifier = 800;
NavigateToDetails();
break;
case 1:
GlobalSupport.MessageIdentifier = 801;
NavigateToDetails();
break;
case 2:
GlobalSupport.MessageIdentifier = 802;
NavigateToDetails();
break;
}
};
actionsheet.ShowInView(this.View);
}
示例4: LoadView
public override void LoadView ()
{
NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
delegate {
var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){
if(args.ButtonIndex > 1)
return;
Email(args.ButtonIndex == 0 ? "png" : "pdf");
};
actionSheet.ShowInView (View);
});
View = new UIView(plotFrame);
image_plotted_by_OxyPlot = new GraphView(plotModel);
image_plotted_by_OxyPlot.Frame = plotFrame;
View.AddSubview(image_plotted_by_OxyPlot);
image_plotted_by_OxyPlot.SetAllowPinchScaling(true);
}
示例5: LoadView
public override void LoadView ()
{
NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
delegate {
var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){
if(args.ButtonIndex > 1)
return;
Email(args.ButtonIndex == 0 ? "png" : "pdf");
};
actionSheet.ShowInView (View);
});
var scrollView = new GraphScrollView(exampleInfo,
new RectangleF(new PointF(0, 0),
new SizeF(UIScreen.MainScreen.ApplicationFrame.Size.Width,
UIScreen.MainScreen.ApplicationFrame.Height -
UIScreen.MainScreen.ApplicationFrame.Top - 10)));
View = scrollView;
}
示例6: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
this.txt.ShouldReturn += (textField) => {
textField.ResignFirstResponder();
return true;
};
this.btn.TouchUpInside += (o,s) => {
var actionSheet = new UIActionSheet ("Send Post?", null, "Cancel", null, "Send"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += ( sender, args) => {
Console.WriteLine ("Clicked on item {0} text: {1}", args.ButtonIndex, this.txt.Text);
if (args.ButtonIndex == 0)
{
MakePost(this.txt.Text);
}
};
actionSheet.ShowInView (View);
};
// Perform any additional setup after loading the view, typically from a nib.
}
示例7: HandleBtnSimpleActionSheetTouchUpInside
protected void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
{
// create an action sheet using the qualified constructor
actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) { Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked"); };
actionSheet.ShowInView (View);
}
示例8: ShareLink
public void ShareLink(string title, string status, string link)
{
var buttonTitle = string.Empty;
var actionSheet = new UIActionSheet("Partilhar");
actionSheet.AddButton("Facebook");
actionSheet.AddButton("Twitter");
actionSheet.Clicked += delegate(object a, UIKit.UIButtonEventArgs b)
{
if(b.ButtonIndex != -1)
{
buttonTitle = actionSheet.ButtonTitle(b.ButtonIndex);
}
};
actionSheet.Dismissed += (sender, e) =>
{
if (buttonTitle.Equals("Facebook"))
{
ShareOnService(SLServiceKind.Facebook, title, status, link);
}
else if (buttonTitle.Equals("Twitter"))
{
ShareOnService(SLServiceKind.Twitter, title, status, link);
}
};
actionSheet.ShowInView(UIApplication.SharedApplication.KeyWindow.RootViewController.View);
}
示例9: LoadView
public override void LoadView ()
{
NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
delegate {
var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
Style = UIActionSheetStyle.Default
};
actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){
if(args.ButtonIndex > 1)
return;
Email(args.ButtonIndex == 0 ? "png" : "pdf");
};
actionSheet.ShowInView (View);
});
// Only for iOS 7 and later?
this.EdgesForExtendedLayout = UIRectEdge.None;
this.View = this.plotView;
}
示例10: ViewDidLoad
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
_picker = new UIImagePickerController ();
_pickerDel = new PickerDelegate (this);
_picker.Delegate = _pickerDel;
_actionSheet = new UIActionSheet ();
_actionSheet.AddButton ("Library");
_actionSheet.AddButton ("Camera");
_actionSheet.AddButton ("Cancel");
_actionSheet.CancelButtonIndex = 2;
_actionSheet.Delegate = new ActionSheetDelegate (this);
showPicker.TouchUpInside += delegate { _actionSheet.ShowInView (this.View); };
playMovie.Hidden = true;
playMovie.TouchUpInside += delegate {
if (_mp != null) {
View.AddSubview (_mp.View);
_mp.SetFullscreen (true, true);
_mp.Play ();
}
};
}
示例11: PickRegisterOption
private void PickRegisterOption()
{
try {
UIActionSheet actionSheet;
actionSheet = new UIActionSheet();
actionSheet.AddButton("Phone");
actionSheet.AddButton("Email");
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
if (b.ButtonIndex == (0)) {
EmailRegisterView.Hidden = true;
PhoneRegisterView.Hidden = false;
SetEditing(false, true);
this.registerMode = this.appDelegate.MODE_REGISTER_PHONE;
} else {
EmailRegisterView.Hidden = false;
PhoneRegisterView.Hidden = true;
this.registerMode = this.appDelegate.MODE_REGISTER_EMAIL;
SetEditing(false, true);
}
};
actionSheet.ShowInView(View);
} catch (Exception ex) {
Console.Write(ex.Message);
}
}
示例12: OnAddAnimalsClick
partial void OnAddAnimalsClick(MonoTouch.Foundation.NSObject sender)
{
var sheet = new UIActionSheet("Add Animals");
sheet.AddButton("Add Dog");
sheet.AddButton("Add Kitten");
sheet.Clicked += HandleAddAnimalClicked;
sheet.ShowInView(this.View);
}
示例13: HandleBtnSimpleActionSheetTouchUpInside
void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
{
// create an action sheet using the qualified constructor
actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
actionSheet.Clicked += (object a, UIButtonEventArgs b) => {
Console.WriteLine (string.Format("Button {0} clicked", b.ButtonIndex));
};
actionSheet.ShowInView (View);
}
示例14: HandleBtnActionSheetWithOtherButtonsTouchUpInside
protected void HandleBtnActionSheetWithOtherButtonsTouchUpInside (object sender, EventArgs e)
{
actionSheet = new UIActionSheet ("action sheet with other buttons");
actionSheet.AddButton ("delete");
actionSheet.AddButton ("a different option!");
actionSheet.AddButton ("another option");
actionSheet.DestructiveButtonIndex = 0;
actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) { Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked"); };
actionSheet.ShowInView (View);
}
示例15: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
this.textView.Text = "";
this.btnReset.TouchUpInside += (sender, e) => {
var actionSheet = new UIActionSheet("Are you sure you want to reset ?", null, "Cancel", "Reset", "?");
actionSheet.Clicked += HandleActionSheetClicked;;
actionSheet.ShowInView(View);
};
}