android TextInputLayout changes EditText style after setting error to null

后端 未结 6 1727
独厮守ぢ
独厮守ぢ 2020-12-31 11:00

for the first time I\'m using the new Android\'s widget TextInputLayout, it\'s very nice but I\'m facing some problem using setError method

this is my xml



        
6条回答
  •  旧时难觅i
    2020-12-31 11:20

    I have a trick to solve this problem simply:

    1,new a class extend android.support.design.widget.TextInputEditText ; 2,overrvide getBackground() method ,make it return null;

    becasue the method updateEditTextBackground() in TextInputLayout will judge if editText's background drawable is null,and now always return null,result is editText's background will not be changed by error text color.

提交回复
热议问题