Skip to content

Solution for SetErrorColor() Android #4

@Antolllkabilyi

Description

@Antolllkabilyi

Hi Alejandro!
Thanks for your great solution. I have found a code for SetErrorColor method https://stackoverflow.com/questions/33709066/how-to-set-textinputlayout-error-message-colour.

if (Element.ErrorColor != null)
{
AColor errorColor = Element.ErrorColor.ToAndroid();

            var fErrorView = Control.Class.GetDeclaredField("mErrorView");
            fErrorView.Accessible = true;
            var mErrorView =(TextView)fErrorView.Get(Control);
            mErrorView.SetTextColor(errorColor);
            mErrorView.RequestLayout();  
        }   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions