TextInputLayout浮动标签显得很慢

时间:2016-12-16 05:05:56

标签: android android-layout

我已经应用了android TextInputLayout,它运行正常。但是当出现文本输入布局时,编辑文本变得非常慢。以及我改变了提示颜色,但它不起作用。

布局xml

 <android.support.design.widget.TextInputLayout
                android:id="@+id/register_input_layout_password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLength="15"
                android:lines="1"
                android:id="@+id/Register_fragment_passwo_field"
                android:hint="Password"
                android:layout_gravity="center_vertical"
                android:paddingLeft="35dp"
                android:textColor="#ffffff"
                android:textColorHint="@android:color/white"
                android:layout_marginTop="5dp" />
            </android.support.design.widget.TextInputLayout>

依赖compile 'com.android.support:design:23.0.1'

3 个答案:

答案 0 :(得分:0)

设置TextInputLayout android:textColorHint="@android:color/white"的此属性以更改提示颜色,我可以看到您的代码,以查找文本变得非常慢的原因。

<android.support.design.widget.TextInputLayout
                    android:id="@+id/register_input_layout_password"
                    android:layout_width="match_parent"
                    android:textColorHint="@android:color/white"
                    android:layout_height="wrap_content">
                <EditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:maxLength="15"
                    android:lines="1"
                    android:id="@+id/Register_fragment_passwo_field"
                    android:hint="Password"
                    android:layout_gravity="center_vertical"
                    android:paddingLeft="35dp"
                    android:textColor="#ffffff"
                    android:textColorHint="@android:color/white"
                    android:layout_marginTop="5dp" />
                </android.support.design.widget.TextInputLayout>

答案 1 :(得分:0)

#define HEVC_EXT    1

如果您更改动画时间,请按以下方式自定义 <!-- if You Can Change Color of TextInputLayout Like this--> <style name="TextLabel" parent="TextAppearance.AppCompat"> <!-- Hint color and label color in FALSE state --> <item name="android:textColorHint">@color/Color Name</item> <item name="android:textSize">20sp</item> <!-- Label color in TRUE state and bar color FALSE and TRUE State --> <item name="colorAccent">@color/Color Name</item> <item name="colorControlNormal">@color/Color Name</item> <item name="colorControlActivated">@color/Color Name</item> </style>

EditText

答案 2 :(得分:0)

 <android.support.design.widget.TextInputLayout
                android:id="@+id/il_second_phone_number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/view_margin_micro"
                android:textColorHighlight="@color/color_darker_gray"
                android:textColorHint="@color/color_darker_gray">

                <EditText
                    android:id="@+id/et_second_phone_number"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/layout_height_normal"
                    android:backgroundTint="@color/color_darker_gray"
                    android:hint="@string/second_phone_number"
                    android:inputType="phone"
                    android:maxLines="1"
                    android:text="@={vm.cPhoneTwo}"
                    android:textColor="@color/color_black" />
            </android.support.design.widget.TextInputLayout>