Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Entry drawing

$
0
0

I have a custom rendering for an entry. The iOS flavor is a UITextField.

I want to draw a thick white line on the bottom of the text.

I tried overriding the Draw(CGRect) method, but I don't see any visual effect.

I tried commenting and un-commenting the base method.

Nothing seems to have any effect ...

    public override void Draw(CGRect rect)
    {
        using (var context = UIGraphics.GetCurrentContext())
        {
      //      base.Draw(rect);

            var ncolor = new CGColor(255, 23, 120);
            var ncolor2 = new CGColor(10, 123, 10);
            context.SetLineWidth(4);

            var path = CGPath.EllipseFromRect(rect);
            context.AddPath(path);
            // context.SetFillColor(this.Element.Color.ToCGColor());
            context.SetFillColor(ncolor);
            context.DrawPath(CGPathDrawingMode.Fill);

            var path2 = CGPath.FromRect(new CGRect(0, 0, 120, 120));
            context.AddPath(path2);
            context.SetFillColor(ncolor2);
            context.DrawPath(CGPathDrawingMode.Fill);

        }
    }

Viewing all articles
Browse latest Browse all 77050

Trending Articles