utLayout标签的颜色和android下划线的edittex

utLayout标签的颜色和android下划线的edittex

本文介绍了如何更改TextinputLayout标签的颜色和android下划线的edittext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用android设计库的TextinputLayout.但是无法自定义TextinputLayoutEditText的提示颜色,标签颜色和下划线颜色.请帮忙.

I am using android design library's TextinputLayout. But couldn't customize the hint color, label color and the underline color of EditText inside TextinputLayout. Please help.

推荐答案

更改底线颜色:

<item name="colorControlNormal">#c5c5c5</item>
<item name="colorControlActivated">@color/accent</item>
<item name="colorControlHighlight">@color/accent</item>

有关更多信息,请此线程..

For more info check this thread.

<style name="MyHintStyle" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/main_color</item>
</style>

并像这样使用它:

<android.support.design.widget.TextInputLayout
    ...
    app:hintTextAppearance="@style/MyHintStyle">

在不是浮动标签时更改提示颜色:

<android.support.design.widget.TextInputLayout
    ...
    app:hintTextAppearance="@style/MyHintStyle"
    android:textColorHint="#c1c2c4">

感谢

这篇关于如何更改TextinputLayout标签的颜色和android下划线的edittext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 19:40