How do I change the text colour of an Entry Element from Black to White

204 views Asked by At

I have a custom entry element class but Id like to change the text field colour from default Back to White. Please note that this is NOT the TextLabel text colour, but rather the text that is entered by the user into the EntryElement. This is what I have so far..

public class StandardEntryElement : EntryElement
{
    public StandardEntryElement (string caption, string placeholder, string value): base(caption,placeholder,value)
    {
    }

    public StandardEntryElement (string caption, string placeholder, string value, bool isPassword) : base(caption,placeholder,value,isPassword)
    {
    }

    public override UITableViewCell GetCell (UITableView tv)
    {
        var theCell =  base.GetCell (tv);
        theCell.BackgroundColor = Resources.CellBackground;
        theCell.TextLabel.TextColor = Resources.LabelTextColor;
        theCell.TextLabel.Text = Caption;
        return theCell;
    }
}
1

There are 1 answers

0
Rogier On

You can't AFAIK, you need access to the private "entry" property which is the actual UITextField.

I ended up pulling the source and altering this little tidbit. Yes, I know I should return the favor but I was on a real time budget then and the proper way would be to have a wrapper property, the same as for UITextAlignment and such.