本文整理汇总了C#中UIImageView.DrawViewHierarchy方法的典型用法代码示例。如果您正苦于以下问题:C# UIImageView.DrawViewHierarchy方法的具体用法?C# UIImageView.DrawViewHierarchy怎么用?C# UIImageView.DrawViewHierarchy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIImageView
的用法示例。
在下文中一共展示了UIImageView.DrawViewHierarchy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateAffordances
private void UpdateAffordances()
{
if (Control == null)
{
return;
}
// Debug.WriteLine ("Content: {0} -> {1}", Control.ContentOffset, Control.ContentSize);
var topFrame = new CGRect (0, 0, Bounds.Width, _topOverlayHeight);
var bottomFrame = new CGRect (0, Bounds.Height - _bottomOverlayHeight, Bounds.Width, _bottomOverlayHeight);
var element = Element as AdvancedListView;
_topOverlayView.Frame = topFrame;
_bottomOverlayView.Frame = bottomFrame;
if (false) {
Element view = element;
while (view as Page == null) {
view = view.Parent;
}
var page = view as Page;
if (_backImage == null && page != null && Window != null) {
if (!String.IsNullOrEmpty (page.BackgroundImage)) {
{
_backImage = UIImage.FromBundle (page.BackgroundImage);
}
}
var referenceView = Window.RootViewController.View;
UIGraphics.BeginImageContext(referenceView.Bounds.Size);
_backImage.DrawAsPatternInRect(referenceView.Bounds);
var image = UIGraphics.GetImageFromCurrentImageContext();
UIGraphics.EndImageContext();
var imageView = new UIImageView () { Image = image, Frame = referenceView.Bounds };
imageView.DrawViewHierarchy (imageView.Bounds, true);
var topViewRect = referenceView.ConvertRectFromView (_topOverlayView.Bounds, _topOverlayView);
_topOverlayView.RemoveFromSuperview ();
_topOverlayView = imageView.ResizableSnapshotView (topViewRect, true, UIEdgeInsets.Zero);
_topOverlayView.Layer.AddSublayer (_topOverlayMask);
_topOverlayView.UserInteractionEnabled = false;
AddSubview (_topOverlayView);
BringSubviewToFront (_topOverlayView);
var bottomViewRect = referenceView.ConvertRectFromView (_bottomOverlayView.Bounds, _bottomOverlayView);
_bottomOverlayView.RemoveFromSuperview ();
_bottomOverlayView = imageView.ResizableSnapshotView (bottomViewRect, true, UIEdgeInsets.Zero);
_bottomOverlayView.Layer.AddSublayer (_bottomOverlayMask);
_bottomOverlayView.UserInteractionEnabled = false;
AddSubview (_bottomOverlayView);
BringSubviewToFront (_bottomOverlayView);
}
}
_topOverlayView.Frame = topFrame;
_topOverlayMask.Frame = _topOverlayView.Bounds;
_bottomOverlayView.Frame = bottomFrame;
_bottomOverlayMask.Frame = _bottomOverlayView.Bounds;
_topOverlayView.Hidden = !(Control.ContentOffset.Y > 0);
_bottomOverlayView.Hidden = !(Control.ContentOffset.Y < (Control.ContentSize.Height - Control.Bounds.Height));
}