private void Initialize() { trackColor = UIColor.FromWhiteAlpha(1f, 1); curvaceousness = 1; trackLayer = new CALayer(); trackLayer.BackgroundColor = UIColor.FromRGB(183, 183, 183).CGColor; Layer.AddSublayer(trackLayer); rangeLayer = new CALayer(); rangeLayer.BackgroundColor = UIColor.FromRGB(0, 122, 255).CGColor; Layer.AddSublayer(rangeLayer); upperKnobLayer = new CERangeSliderKnobLayer(); upperKnobLayer.Name = "Upper"; upperKnobLayer.Slider = this; Layer.AddSublayer(upperKnobLayer); lowerKnobLayer = new CERangeSliderKnobLayer(); lowerKnobLayer.Name = "Lower"; lowerKnobLayer.Slider = this; Layer.AddSublayer(lowerKnobLayer); SetLayerFrames(); }
private void SetKnobLayer(nfloat centerPosition, CERangeSliderKnobLayer layer) { layer.Frame = new CGRect(centerPosition - knobWidth / 2f, 0, knobWidth, knobWidth); layer.ShadowOffset = new SizeF(0, 3); layer.ShadowOpacity = 0.4f; layer.ShadowColor = UIColor.Gray.CGColor; layer.SetNeedsDisplay(); }