Hello,
textInputLayout.DefaultHintTextColor; Sets the text color used by the hint in both the collapsed and expanded states
textInputLayout.HintTextColor Sets the collapsed hint text color
They are different, Which one to use depends on your choice.
I make a test with DefaultHintTextColor
and create a ColorStateList
to set the enabled state, and set color to red for enabled state.
protected override TextInputLayout CreateNativeView()
{
int[][] states= new int[][] {
new int[] { Android.Resource.Attribute.StateEnabled}, // enabled
};
int[] colors = new int[] {
Android.Graphics.Color.Red,
};
ColorStateList myList = new ColorStateList(states, colors);
TextInputLayout layout = new TextInputLayout(Context);
layout.DefaultHintTextColor = myList;
TextInputEditText inputEditText = new TextInputEditText(layout.Context);
inputEditText.Hint = "this is a hint text";
layout.AddView(inputEditText);
return layout;
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.