代码如下所示ViewCompat.setBackgroundTintList(textInputEditText, new ColorStateListnew int[][]{new int[]{}}, new int[]{getResources().getColor(android.R.color.holo_red_dark)}));
当编辑文本聚焦时,行的颜色将更改为colorAccent。当编辑文本聚焦<
我的目标是以编程方式更改TextInputEditText中的提示标签和下划线颜色。过了一段时间后,我终于让它们都在测试环境中工作了,但当在我真正的应用程序中实现时,下划线突然停止了工作。要更改颜色,只需使用BackgroundTintList: new int[] {android.R.attr.state_focused