android更改EditText下划线颜色

在res——》values——》themes中添加下列代码

<style name="editTextStyle">
<!--选中时下划线的颜色-->
<item name="colorControlActivated">@color/gray1</item>
<!--默认时下划线的颜色-->
<item name="colorControlNormal">@color/black</item>
</style>

之后在需要需要使用的地方用

android:theme="@style/editTextStyle"

引用就好了

 

 

 

参考——

https://blog.csdn.net/Farewell_w/article/details/104621962/

posted @ 2024-04-26 22:14  椰子灰  阅读(488)  评论(0)    收藏  举报