当前位置: 首页>>代码示例>>C#>>正文


C# UIActionSheet.AddSubviews方法代码示例

本文整理汇总了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));
        }
开发者ID:WCSandbox,项目名称:xamarin-store-app,代码行数:20,代码来源:StringUIPicker.cs

示例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);
     }
 }
开发者ID:KraigM,项目名称:xamarin-store-app,代码行数:38,代码来源:StringUIPicker.cs


注:本文中的UIActionSheet.AddSubviews方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。