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


C# UIImageView.DrawViewHierarchy方法代码示例

本文整理汇总了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));
        }
开发者ID:programmation,项目名称:AdvancedCustomRendererTest,代码行数:62,代码来源:AdvancedListViewRenderer.cs


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