本文整理汇总了C#中UIActionSheet.AddSubviews方法的典型用法代码示例。如果您正苦于以下问题:C# UIActionSheet.AddSubviews方法的具体用法?C# UIActionSheet.AddSubviews怎么用?C# UIActionSheet.AddSubviews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIActionSheet
的用法示例。
在下文中一共展示了UIActionSheet.AddSubviews方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowPicker
public void ShowPicker(UIView viewForPicker)
{
sheet = new UIActionSheet();
sheet.AddSubview(this);
var toolbarPicker = new UIToolbar (new RectangleF (0, 0, viewForPicker.Frame.Width, 44)) {
Items = new[] {
new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace),
new UIBarButtonItem (UIBarButtonSystemItem.Done, (sender, args) => sheet.DismissWithClickedButtonIndex (0, true)),
},
BarTintColor = this.BackgroundColor,
};
sheet.AddSubviews(toolbarPicker);
sheet.BackgroundColor = UIColor.Clear;
sheet.ShowInView(viewForPicker);
Animate(.25, () => sheet.Bounds = new RectangleF (0, 0, viewForPicker.Frame.Width, 485));
}
示例2: ShowPicker
public void ShowPicker(UIView viewForPicker, RectangleF location)
{
var toolbar = new UIToolbar (new RectangleF (0, 0, 320, 44)) {
Items = new[] {
new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace),
new UIBarButtonItem (UIBarButtonSystemItem.Done, (s, e) =>
{
if (sheet != null) {
sheet.DismissWithClickedButtonIndex (0, true);
sheet = null;
}
if (popover != null) {
popover.Dismiss(true);
popover = null;
}
})
},
BarStyle = UIBarStyle.Default,
};
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
sheet = new UIActionSheet ();
sheet.AddSubview (this);
sheet.AddSubviews (toolbar);
sheet.BackgroundColor = UIColor.Clear;
sheet.ShowInView (viewForPicker);
UIView.Animate (.25, () => sheet.Bounds = new RectangleF (0, 0, viewForPicker.Frame.Width, 485));
} else {
this.Frame = new RectangleF (0, 44, 320, 216);
var view = new UIView ();
view.Add (this);
view.Add (toolbar);
var vc = new UIViewController ();
vc.View = view;
vc.PreferredContentSize = new SizeF (320, 260);
popover = new UIPopoverController (vc);
popover.PresentFromRect (location, viewForPicker, UIPopoverArrowDirection.Down, true);
}
}