如何更改文本输入布局的样式?

时间:2019-02-23 16:51:27

标签: android android-textinputlayout androiddesignsupport

我真的很困惑更改编辑文本的颜色,我想更改底线的颜色,我不知道为什么它仍然是绿色,而所有都是绿色。请看一下我的设计代码

<android.support.design.widget.TextInputLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColorHint="@color/blue"
                    style="@style/blueTextInputLayout"
                    android:layout_gravity="center"
                    android:gravity="center">

                    <EditText
                        android:id="@+id/email_edit_text"
                        style="@style/EditTextStyle"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="@string/email" />

                </android.support.design.widget.TextInputLayout>

和我的样式颜色

 <style name="blueTextInputLayout"  parent="TextAppearance.AppCompat">
        <!-- Hint color and label color in FALSE state -->
        <item name="android:textColorHint">@color/blue</item>
        <item name="android:textSize">20sp</item>
        <!-- Label color in TRUE state and bar color FALSE and TRUE State -->
        <item name="colorAccent">@color/blue</item>
        <item name="colorControlNormal">@color/blue</item>
        <item name="colorControlActivated">@color/blue</item>
    </style>
<style name="EditTextStyle" parent="Widget.AppCompat.EditText">
        <item name="android:colorControlHighlight">@color/blue</item>
        <item name="android:colorActivatedHighlight">@color/blue</item>
        <item name="android:textColorHint">@color/blue</item>
        <item name="android:textCursorDrawable">@null</item>
        <item name="android:textColor">@color/blue</item>
        <item name="android:backgroundTint">@color/blue</item>
    </style>

这是结果 enter image description here

0 个答案:

没有答案