void SetPlaceholderTextColor(Common.LineEntry view) { if (string.IsNullOrEmpty(view.Placeholder) == false && view.PlaceholderColor != Color.Default) { var placeholderString = new NSAttributedString(view.Placeholder, new UIStringAttributes { ForegroundColor = view.PlaceholderColor.ToUIColor() }); Control.AttributedPlaceholder = placeholderString; } }
void DrawBorder(Common.LineEntry view) { var borderLayer = new CALayer(); borderLayer.MasksToBounds = true; borderLayer.Frame = new CoreGraphics.CGRect(0f, Frame.Height / 2, Frame.Width, 1f); borderLayer.BorderColor = view.BorderColor.ToCGColor(); borderLayer.BorderWidth = 0.5f; Control.Layer.AddSublayer(borderLayer); Control.BorderStyle = UITextBorderStyle.None; }
void SetFontSize(Common.LineEntry view) { double EPS = 1e-9; if (System.Math.Abs(view.FontSize - Font.Default.FontSize) > EPS) { Control.Font = UIFont.SystemFontOfSize((System.nfloat)view.FontSize); } else if (System.Math.Abs(view.FontSize - Font.Default.FontSize) < EPS) { Control.Font = UIFont.SystemFontOfSize(17f); } }