这是我的代码
emailEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
EditText txtUser = (EditText) v;
String userName = txtUser.getText().toString();
if (!userName.isEmpty()) {
if (!isvaliduser(userName)&&!isValidEmail(userName)) {
inputLayoutEmail.setHint("email/snipe id is required to login");
}
} else {
inputLayoutEmail.setHint("email / snipe ID");
// inputLayoutEmail.setHintTextAppearance(R.style.hintText);
}
}
}
});
我想应用提示颜色。我正在使用set提示外观。但它不能正常工作。提前谢谢。
答案 0 :(得分:0)
请改用setHintTextColor。
inputLayoutEmail.setHintTextColor(ContextCompat.getColor(context,R.color.black));