I am trying to set the placeholder text for a UITextField to a different color. I have learned that I need to subclass and override drawPlaceholderInRect method.
iP
The original ObjC code does not call super
(it's base method) but drawInRect:
. Have you tried the same with MonoTouch ? e.g.
public override void DrawPlaceholder (RectangleF rect)
{
using (UIFont font = UIFont.SystemFontOfSize (16))
using (UIColor col = new UIColor (0,0,255.0,0.7)) {
col.SetFill ();
base.DrawString (rect, font);
}
}
Note: drawInRect:WithFont:
maps to the DrawString
extension method in C# (which can be called on any string
).