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


C# UIView.ConvertRectFromView方法代码示例

本文整理汇总了C#中UIView.ConvertRectFromView方法的典型用法代码示例。如果您正苦于以下问题:C# UIView.ConvertRectFromView方法的具体用法?C# UIView.ConvertRectFromView怎么用?C# UIView.ConvertRectFromView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIView的用法示例。


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

示例1: PresentPopover

		public void PresentPopover(RectangleF rect, UIView inView, UIPopoverArrowDirection arrowDirection, bool animated)
		{
			this.DismissPopover(false);
			
			if(this.ContentViewController.View != null) { 
				//obj-C selector calls [vc getView] which calls loadView
			}
			
			if(this.ContentSize == SizeF.Empty) {
				this.ContentSize = this.ContentViewController.ContentSizeForViewInPopover;	
			}
			
			var displayArea = CalculateDisplayArea(inView);
			var properties = this.Properties ?? DefaultContainerModel;
			var containerView = new PopoverContainerView(this.ContentSize, rect, displayArea, arrowDirection, properties);
			this.ArrowDirection = containerView.PopoverArrowDirection;
			
			var keyView = this.GetKeyView();
			
			BackgroundView = new TouchableView() { Frame = keyView.Bounds };
			BackgroundView.ContentMode = UIViewContentMode.ScaleToFill;
			BackgroundView.BackgroundColor = UIColor.Clear;
			BackgroundView.ViewWasTouched = this.ViewWasTouched;
			BackgroundView.AutoresizingMask = 
					UIViewAutoresizing.FlexibleLeftMargin |
					UIViewAutoresizing.FlexibleWidth |
					UIViewAutoresizing.FlexibleRightMargin |
					UIViewAutoresizing.FlexibleTopMargin |
					UIViewAutoresizing.FlexibleHeight |
					UIViewAutoresizing.FlexibleBottomMargin;
			
			
			keyView.AddSubview(BackgroundView);
			
			containerView.Frame = inView.ConvertRectFromView(containerView.Frame, BackgroundView);
			BackgroundView.AddSubview(containerView);
			
			containerView.SetContentView(ContentViewController.View);
			containerView.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
			
			this.View = containerView;
			this.UpdateBackgroundPassthroughViews();
			this.ContentViewController.ViewWillAppear(animated);
			
			this.View.BecomeFirstResponder();
			
			if(animated) {
				this.View.Alpha = 0.0f;
				
				UIView.BeginAnimations("FadeIn", IntPtr.Zero);
				UIView.SetAnimationDuration(FadeDuration);
				UIView.SetAnimationDelegate(this);
			    UIView.SetAnimationDidStopSelector(new MonoTouch.ObjCRuntime.Selector("animationDidStop:finished:context:"));

				this.View.Alpha = 1.0f;
				
				UIView.CommitAnimations();
			}
			else {
				IsPopoverVisible = true;
				this.ContentViewController.ViewDidAppear(animated);
			}
		}
开发者ID:ahsan-rana,项目名称:Devnos.Popover,代码行数:63,代码来源:PopoverController.cs


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