本文整理汇总了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);
}
}