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


C# UIPopoverController类代码示例

本文整理汇总了C#中UIPopoverController的典型用法代码示例。如果您正苦于以下问题:C# UIPopoverController类的具体用法?C# UIPopoverController怎么用?C# UIPopoverController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIPopoverController类属于命名空间,在下文中一共展示了UIPopoverController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NumberEntryView

        public NumberEntryView()
        {
            BackgroundColor = UIColor.White;
            BorderStyle = UITextBorderStyle.RoundedRect;
            this.KeyboardType = UIKeyboardType.DecimalPad;
            this.ShouldBeginEditing = (t) =>{
                if(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone || popover != null && popover.PopoverVisible)
                    return true;
                var num = new NumberInputViewController(this);
                popover = new UIPopoverController(num){

                };
                popover.PresentFromRect(this.Frame,this.Superview, UIPopoverArrowDirection.Any,true);
                popover.DidDismiss += (object sender, EventArgs e) => {
                    this.ResignFirstResponder();
                    popover.Dispose();
                    num.Dispose();
                    popover = null;
                };

                this.SelectAll(this);
                return true;
            };
            this.EditingDidEnd += (s,e) => {
                if(NewValue != null)
                    NewValue(Text);
                if(popover != null && popover.PopoverVisible)
                    popover.Dismiss(true);
            };
            this.InputView = new UIView (new RectangleF (0, 0, 0, 0));
        }
开发者ID:nagyist,项目名称:iPadPos,代码行数:31,代码来源:NumberEntryView.cs

示例2: Initialize

        void Initialize()
        {
            _timingItemManager = null;//  new TimingItemManager () { Race = new Race() { Name = _details.Race, Code = _details.Race}, Location =  _details.Location, Token = _details.OurLittleSecret};

            _popover = new SettingsDialogViewController (_details.Location, _details.OurLittleSecret);
            UIPopoverController myPopOver = new UIPopoverController(_popover);
            _popover.Changed += () =>
            {
                _details.Location = _popover.Location;
                _details.OurLittleSecret = _popover.Secret;
            //				_timingItemManager = new TimingItemManager () { Race = new Race() { Name = _details.Race, Code = _details.Race}, Location =  _details.Location, Token = _details.OurLittleSecret};
                PopulateTable(true);
            };
            _popover.Clear += () =>
            {
                // _timingItemManager.Reset();
                _details.Reset();
                PopulateTable(false);
            };
            _popover.Save += () => {
            //				_timingItemManager.SaveItem (null);
                _popover.UpdateStatus(_timingItemManager.Status);
            };

            NavigationItem.RightBarButtonItem = new UIBarButtonItem("Settings", UIBarButtonItemStyle.Plain, null);
            NavigationItem.RightBarButtonItem.Clicked += (sender, e) => { myPopOver.PopoverContentSize = new SizeF(450f, 800f);
                myPopOver.PresentFromBarButtonItem (NavigationItem.RightBarButtonItem, UIPopoverArrowDirection.Left, true); };
            PopulateTable (true);
        }
开发者ID:unsliced,项目名称:head-race-management,代码行数:29,代码来源:TimingMasterViewController.cs

示例3: showInfo

		partial void showInfo (NSObject sender)
		{
			if (UserInterfaceIdiomIsPhone) {
				var controller = new FlipsideViewController () {
					ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal,
				};
				
				controller.Done += delegate {
					this.DismissModalViewControllerAnimated (true);
				};
				
				this.PresentModalViewController (controller, true);
			} else {
				if (flipsidePopoverController == null) {
					var controller = new FlipsideViewController ();
					flipsidePopoverController = new UIPopoverController (controller);
					controller.Done += delegate {
						flipsidePopoverController.Dismiss (true);
					};
				}
				
				if (flipsidePopoverController.PopoverVisible) {
					flipsidePopoverController.Dismiss (true);
				} else {
					flipsidePopoverController.PresentFromBarButtonItem ((UIBarButtonItem)sender, UIPopoverArrowDirection.Any, true);
				}
			}
		}
开发者ID:holisticware-admin,项目名称:HolisticWare.TheGeekGathering.Workshop,代码行数:28,代码来源:MainViewController.cs

示例4: SaveAndLaunchFile

        public Task SaveAndLaunchFile(Stream stream, string fileType)
        {
            if (OriginView == null) return Task.FromResult(true);

            var data = NSData.FromStream(stream);
            var width = 824;
            var height = 668;

            var popoverView = new UIView(new RectangleF(0, 0, width, height));
            popoverView.BackgroundColor = UIColor.White;
            var webView = new UIWebView();
            webView.Frame = new RectangleF(0, 45, width, height - 45);

            var b = new UIButton(UIButtonType.RoundedRect);
            b.SetTitle("Done", UIControlState.Normal);
            b.Frame = new RectangleF(10,10, 60, 25);
            b.TouchUpInside += (o, e) => _popoverController.Dismiss(true);

            popoverView.AddSubview(b);
            popoverView.AddSubview(webView);

            var bundlePath = NSBundle.MainBundle.BundlePath;
            System.Diagnostics.Debug.WriteLine(bundlePath);
            webView.LoadData(data, "application/pdf", "utf-8", NSUrl.FromString("http://google.com"));

            var popoverContent = new UIViewController();
            popoverContent.View = popoverView;

            _popoverController = new UIPopoverController(popoverContent);
            _popoverController.PopoverContentSize = new SizeF(width, height);
            _popoverController.PresentFromRect(new RectangleF(OriginView.Frame.Width/2, 50, 1, 1), OriginView, UIPopoverArrowDirection.Any, true);
            _popoverController.DidDismiss += (o, e) => _popoverController = null;

            return Task.FromResult(true);
        }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:35,代码来源:PlatformServices.cs

示例5: ShareUrl

        public void ShareUrl(object sender, Uri uri)
        {
            var item = new NSUrl(uri.AbsoluteUri);
            var activityItems = new NSObject[] { item };
            UIActivity[] applicationActivities = null;
            var activityController = new UIActivityViewController (activityItems, applicationActivities);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) 
            {
                var window = UIApplication.SharedApplication.KeyWindow;
                var pop = new UIPopoverController (activityController);

                var barButtonItem = sender as UIBarButtonItem;
                if (barButtonItem != null)
                {
                    pop.PresentFromBarButtonItem(barButtonItem, UIPopoverArrowDirection.Any, true);
                }
                else
                {
                    var rect = new CGRect(window.RootViewController.View.Frame.Width / 2, window.RootViewController.View.Frame.Height / 2, 0, 0);
                    pop.PresentFromRect (rect, window.RootViewController.View, UIPopoverArrowDirection.Any, true);
                }
            } 
            else 
            {
                var viewController = UIApplication.SharedApplication.KeyWindow.RootViewController;
                viewController.PresentViewController(activityController, true, null);
            }
        }
开发者ID:zdd910,项目名称:CodeHub,代码行数:29,代码来源:ActionMenuFactory.cs

示例6: OnElementChanged

        protected override void OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs<Xamarin.Forms.Button> e)
        {
            base.OnElementChanged (e);

            if (e.NewElement != null) {
                Control.TouchUpInside += delegate(object sender, EventArgs e2) {

                    var formsView = new CommonFormsView ();

                    var rect = new CGRect (0, 0, 400, 400);
                    var iOSView = FormsViewToNativeiOS.ConvertFormsToNative (formsView, rect);

                    var viewController = new UIViewController();
                    viewController.Add(iOSView);
                    viewController.View.Frame = rect;

                    var popoverController = new UIPopoverController(viewController);
                    popoverController.ContentViewController.View.BackgroundColor = viewController.View.BackgroundColor;
                    popoverController.PopoverContentSize = rect.Size;
                    var frame = UIApplication.SharedApplication.KeyWindow.RootViewController.View.Frame;
                    popoverController.PresentFromRect (Control.Frame, UIApplication.SharedApplication.KeyWindow.RootViewController.View, 0, true);

                };
            }
        }
开发者ID:berlamont,项目名称:LoadingFormsViewFromNative,代码行数:25,代码来源:NativeButtonRenderer.cs

示例7: WillHideViewController

			public override void WillHideViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
			{
				barButtonItem.Title =  "MasterList";
				var items = new List<UIBarButtonItem> (Parent.Toolbar.Items);
				items.Insert (0, barButtonItem);
				Parent.Toolbar.SetItems (items.ToArray (), true);
				Parent.MainPopoverController = pc;
			}
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:8,代码来源:DetailViewController.cs

示例8: WillHideViewController

 public override void WillHideViewController(UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
 {
     _svc = svc as SplitViewController;
     _lefty = barButtonItem;
     _lefty.Title = "Home";
     _pc = pc;
     ReplaceDetailNavigationViewController();
 }
开发者ID:benhorgen,项目名称:monocross_helpers,代码行数:8,代码来源:SplitViewControllerDelegate.cs

示例9: WillHideViewController

		public override void WillHideViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
		{
			SpeakerSessionMasterDetail dvc = svc.ViewControllers[1] as SpeakerSessionMasterDetail;
			
			if (dvc != null) {
				dvc.AddNavBarButton (barButtonItem);
				dvc.Popover = pc;
			}
		}
开发者ID:Adameg,项目名称:mobile-samples,代码行数:9,代码来源:SpeakerSplitView.cs

示例10: PresentFromPopover

 public void PresentFromPopover(UIView sender,float x,float y)
 {
     popover = new UIPopoverController(this)
     {
         PopoverContentSize = new SizeF(400, 590)
     };
     popover.PresentFromRect (new CoreGraphics.CGRect (x, y, 1, 1), sender, UIPopoverArrowDirection.Any, true);
     this.View.Layer.Frame = new CoreGraphics.CGRect (0, 0, 400, 590);
 }
开发者ID:Nahidahmed,项目名称:iProPQRS,代码行数:9,代码来源:QualityMetricsASA.cs

示例11: WillHideViewController

		public override void WillHideViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
		{
			PatientDetailViewController dvc = svc.ViewControllers[1] as PatientDetailViewController;
			
			if (dvc != null) {
				dvc.AddNavBarButton (barButtonItem);
				dvc.Popover = pc;
			}
		}
开发者ID:DnyaneshwarWadghanePM,项目名称:notes-for-nurses-redux,代码行数:9,代码来源:PatientSplitViewController.cs

示例12: WillHideViewController

		public override void WillHideViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
		{
			SessionSpeakersMasterDetail dvc = svc.ViewControllers[1] as SessionSpeakersMasterDetail;
			
			if (dvc != null) {
				dvc.AddNavBarButton (barButtonItem);
				dvc.Popover = pc;
			} else Console.WriteLine ("SessionSplitViewController dvc == null (hide)");
		}
开发者ID:slodge,项目名称:mobile-samples,代码行数:9,代码来源:SessionSplitView.cs

示例13: PresentFromPopover

        public void PresentFromPopover(UIView sender,float x,float y,float vwidth)
        {
            popover = new UIPopoverController(this)
            {

                PopoverContentSize = new SizeF(vwidth, 600)
            };
            popover.PresentFromRect (new CoreGraphics.CGRect (x, y, 1, 1), sender, UIPopoverArrowDirection.Any, true);
        }
开发者ID:Nahidahmed,项目名称:iProPQRS,代码行数:9,代码来源:ImagesGalleryView.cs

示例14: WillHideViewController

		public override void WillHideViewController (UISplitViewController svc, UIViewController aViewController, UIBarButtonItem barButtonItem, UIPopoverController pc)
		{
			barButtonItem.Title = "Workouts";
			var tabBarViewController = (UITabBarController)svc.ViewControllers[1];			
			var detailsNavController = (UINavigationController)tabBarViewController.SelectedViewController;

			detailsNavController.ViewControllers[0].NavigationItem.SetLeftBarButtonItem (barButtonItem, true);

			controller.Popover = pc;
		}
开发者ID:sakr2015,项目名称:eforsah_v1.1,代码行数:10,代码来源:SplitViewDelegate.cs

示例15: PresentFromPopover

        public void PresentFromPopover(UIView sender)
        {
            popover = new UIPopoverController(this)
            {
                PopoverContentSize = new SizeF(320, 350)
            };

            var frame = new RectangleF(0, 0,(float)sender.Frame.Width, (float)sender.Frame.Height);
            popover.PresentFromRect(frame, sender, UIPopoverArrowDirection.Down, true);
        }
开发者ID:Nahidahmed,项目名称:iProPQRS,代码行数:10,代码来源:FacilityDropDownViewController.cs


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