public override void LayoutSubviews() { base.LayoutSubviews(); BackgroundView.Frame = Bounds.Inset(1, 1); CircleImageView.Frame = BackgroundView.Frame; SelectionLayer.Frame = Bounds; switch (SelectionType) { case SelectionType.Middle: SelectionLayer.Path = UIBezierPath.FromRect(SelectionLayer.Bounds).CGPath; break; case SelectionType.LeftBorder: SelectionLayer.Path = UIBezierPath.FromRoundedRect(SelectionLayer.Bounds, UIRectCorner.TopLeft | UIRectCorner.BottomLeft, new CGSize(SelectionLayer.GetFs_width() / 2, SelectionLayer.GetFs_width() / 2) ).CGPath; break; case SelectionType.RightBorder: SelectionLayer.Path = UIBezierPath.FromRoundedRect(SelectionLayer.Bounds, UIRectCorner.TopRight | UIRectCorner.BottomRight, new CGSize(SelectionLayer.GetFs_width() / 2, SelectionLayer.GetFs_width() / 2) ).CGPath; break; case SelectionType.Single: var diameter = Math.Min(SelectionLayer.GetFs_height(), SelectionLayer.GetFs_width()); SelectionLayer.Path = UIBezierPath.FromOval(new CGRect(SelectionLayer.GetFs_width() / 2 - diameter / 2, SelectionLayer.GetFs_height() / 2 - diameter / 2, diameter, diameter )).CGPath; break; default: break; } }