Hello,
I'm trying to make a view that looks like this on iOS in a Xamarin.Forms PCL:
My strategy has been subclassing Editor in the PCL and subclassing EditorRenderer in the iOS project. I'm insetting the text like so:
var nativeTextView = (UITextView)Control;
nativeTextView.TextContainerInset = new UIEdgeInsets (20, 5, 0, 5);
And overriding Draw like so, to carve out that little arrow at the top, but it doesn't seem to affect the view at all, even though Draw is being called. It just looks like a plain UITextView with inset text and a background color:
base.Draw (rect);
using (CGContext g = UIGraphics.GetCurrentContext ()) {
g.SetLineWidth (1);
path = new CGPath ();
g.SetFillColor (Color.White.ToCGColor ());
g.SetStrokeColor (Color.White.ToCGColor ());
path.AddLines (new PointF[] {
new PointF (0, 0),
new PointF (0, 10),
new PointF (15, 10),
new PointF (25, 0),
new PointF (35, 10),
new PointF (300, 10),
new PointF (300, 0)
});
path.CloseSubpath ();
g.AddPath(path);
g.DrawPath (CGPathDrawingMode.FillStroke);
}
Am I missing something silly? This strategy worked when I overrode Draw on a UIView subclass in a Xamarin.iOS project (not cross-platform).