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


C# CALayer.InsertSublayerAbove方法代码示例

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


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

示例1: StoreCellLayer

        public static CALayer StoreCellLayer(RectangleF frame)
        {
            CALayer layer = new CALayer();
            layer.Frame = frame;

            CALayer backgroundLayer = new CALayer();
            backgroundLayer.Frame = new RectangleF(0, 0, frame.Width, frame.Height);
            backgroundLayer.BackgroundColor = UIColor.FromRGBA(19, 19, 19, 255).CGColor;
            layer.InsertSublayer(backgroundLayer, 0);

            CALayer topLayer1 = new CALayer();
            topLayer1.Frame = new RectangleF(0, 0, frame.Width, 1);
            topLayer1.BackgroundColor = UIColor.FromRGBA(25, 27, 28, 255).CGColor;
            layer.InsertSublayerAbove(topLayer1, backgroundLayer);

            CALayer topLayer2 = new CALayer();
            topLayer2.Frame = new RectangleF(0, 1, frame.Width, 1);
            topLayer2.BackgroundColor = UIColor.FromRGBA(10, 10, 10, 255).CGColor;
            layer.InsertSublayerAbove(topLayer2, backgroundLayer);

            CALayer bottomLayer1 = new CALayer();
            bottomLayer1.Frame = new RectangleF(0, frame.Height - 2, frame.Width, 1);
            bottomLayer1.BackgroundColor = UIColor.FromRGBA(23, 25, 26, 255).CGColor;
            layer.InsertSublayerAbove(bottomLayer1, backgroundLayer);

            CALayer bottomLayer2 = new CALayer();
            bottomLayer2.Frame = new RectangleF(0, frame.Height - 1, frame.Width, 1);
            bottomLayer2.BackgroundColor = UIColor.FromRGBA(42, 43, 44, 255).CGColor;
            layer.InsertSublayerAbove(bottomLayer2, backgroundLayer);

            return layer;
        }
开发者ID:GrimmRanger,项目名称:FGUtils,代码行数:32,代码来源:LayerHelper.cs

示例2: SinkContourLayer

        public static CALayer SinkContourLayer(RectangleF frame, float radius)
        {
            CALayer layer = new CALayer();
            layer.Frame = frame;
            layer.CornerRadius = radius;

            CALayer topLayer = new CALayer();
            topLayer.Frame = new RectangleF(0, -1f, frame.Width, frame.Height);
            topLayer.CornerRadius = radius;
            topLayer.BackgroundColor = UIColor.FromRGBA(150, 150, 150, 255).CGColor;
            layer.InsertSublayerAbove(topLayer, layer);

            CALayer bottomLayer = new CALayer();
            bottomLayer.Frame = new RectangleF(0, 1f, frame.Width, frame.Height);
            bottomLayer.CornerRadius = radius;
            bottomLayer.BackgroundColor = UIColor.FromRGBA(40, 40, 40, 255).CGColor;
            layer.InsertSublayerAbove(bottomLayer, layer);

            CAGradientLayer leftLayer = new CAGradientLayer();
            leftLayer.Frame = new RectangleF(-1f, 0, frame.Width, frame.Height);
            leftLayer.CornerRadius = radius;
            leftLayer.Colors =  new MonoTouch.CoreGraphics.CGColor[]
            {
                UIColor.FromRGBA(100, 100, 100, 255).CGColor,
                UIColor.FromRGBA(40, 40, 40, 255).CGColor
            };
            layer.InsertSublayerAbove(leftLayer, layer);

            CAGradientLayer rightLayer = new CAGradientLayer();
            rightLayer.Frame = new RectangleF(1f, 0, frame.Width, frame.Height);
            rightLayer.CornerRadius = radius;
            rightLayer.Colors =  new MonoTouch.CoreGraphics.CGColor[]
            {
                UIColor.FromRGBA(100, 100, 100, 255).CGColor,
                UIColor.FromRGBA(40, 40, 40, 255).CGColor
            };
            layer.InsertSublayerAbove(rightLayer, layer);

            return layer;
        }
开发者ID:GrimmRanger,项目名称:FGUtils,代码行数:40,代码来源:LayerHelper.cs


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