void SetPlaceholderTextColor(NoLineEntry 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 SetFontSize(NoLineEntry view) { if (view.FontSize != Font.Default.FontSize) { Control.Font = UIFont.SystemFontOfSize((System.nfloat)view.FontSize); } else if (view.FontSize == Font.Default.FontSize) { Control.Font = UIFont.SystemFontOfSize(17f); } }
void DrawBorder(NoLineEntry view) { var borderLayer = new CALayer(); borderLayer.MasksToBounds = true; borderLayer.Frame = new CoreGraphics.CGRect(0f, Frame.Height / 2, Frame.Width, 1f); borderLayer.BorderColor = Color.Transparent.ToCGColor(); borderLayer.BorderWidth = 0.0f; Control.Layer.AddSublayer(borderLayer); Control.BorderStyle = UITextBorderStyle.None; }
private void SetLineColor(NoLineEntry entry) { var andColor = Color.Transparent.ToAndroid(); Control.SetHighlightColor(andColor); var shape = new ShapeDrawable(new RectShape()); shape.Paint.Color = andColor; shape.Paint.StrokeWidth = 0; shape.Paint.SetStyle(Paint.Style.Stroke); Control.SetBackground(shape); Control.SetTextSize(ComplexUnitType.Px, 40); }