我的应用程序使用了Theme.Holo主题,但我想要改变EditText下划线边框的颜色。
我不想要完整的边框,只是想要在Android 4.0及以上版本中更改EditText布局的颜色。
我该怎么做呢?
我的应用程序使用了Theme.Holo主题,但我想要改变EditText下划线边框的颜色。
我不想要完整的边框,只是想要在Android 4.0及以上版本中更改EditText布局的颜色。
我该怎么做呢?
int color = Color.parse("#HEX")
editText.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
android:background="@drawable/edit_text_holo_light
保存项目并运行。
backgroundTint
是 API 21 及以上版本可用。 - IgorGanapolsky