本文整理汇总了C#中CALayer.InsertSublayer方法的典型用法代码示例。如果您正苦于以下问题:C# CALayer.InsertSublayer方法的具体用法?C# CALayer.InsertSublayer怎么用?C# CALayer.InsertSublayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CALayer
的用法示例。
在下文中一共展示了CALayer.InsertSublayer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BrightlyBlurredUIView
public BrightlyBlurredUIView()
{
toolbar = new UIToolbar {
Opaque = true,
};
this.Layer.AddSublayer(blurLayer = toolbar.Layer);
accentView = new UIView {
BackgroundColor = this.TintColor,
Alpha = .7f,
Opaque = false
};
blurLayer.InsertSublayer(accentLayer = accentView.Layer,1);
this.Layer.MasksToBounds = true;
this.BackgroundColor = UIColor.Clear;
}
示例2: 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;
}