안녕하세요. 나는 문제가있다. 포커스가있을 때 EditText 드로어 블의 색상을 변경하고 포커스가 변경되면 다시 기본 색상으로 변경합니다. 지원 라이브러리가 업데이트 될 때까지 모든 것이 좋았습니다. (그것이 제 가정입니다.) 드로어 블의 색상이 정상으로 돌아 가지 않습니다. 사전에 감사의 모두가 =)edittext에서 드로어 블에서 색조 색을 제거하는 방법은 무엇입니까?
이 내 코드입니다 :
@Override
public Drawable setTint(Drawable d, int color) {
Drawable wrappedDrawable = DrawableCompat.wrap(d);
DrawableCompat.setTint(wrappedDrawable, color);
return wrappedDrawable;
}
@Override
public void setEditTextDrawables(final EditText editText, final int drawable) {
editText.setCompoundDrawablesWithIntrinsicBounds(drawable, 0, 0, 0);
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean b) {
if (b){
Drawable icon = getResources().getDrawable(drawable);
editText.setCompoundDrawablesWithIntrinsicBounds(setTint(icon,
getResources().getColor(R.color.colorAccent)), null, null, null);
}else if (!b){
Drawable icon = getResources().getDrawable(drawable);
editText.setCompoundDrawablesWithIntrinsicBounds(setTint(icon,
getResources().getColor(R.color.colorGreyIcon)), null, null, null);
}
}
});
}
이 앱에서 화면입니다 :
"만약 (나) 다른 경우 (나!)"에 그냥 "경우 (b)는 다른". – Funktional