【发布时间】:2018-01-06 13:51:52
【问题描述】:
我想在 TEXT INPUT LAYOUT 处于聚焦或未聚焦状态时将提示的颜色更改为相同。我有两个 TEXT INPUT LAYOUT 字段。两个字段颜色相同。但它在聚焦状态下出现颜色但未聚焦声明默认的灰色出现。我想在焦点和非焦点状态下保持提示的颜色相同。
<com.example.viveka.snipeid.CustomTextInputLayout
android:id="@+id/input_layout_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
app:errorEnabled="true"
>
<EditText
android:id="@+id/editEmail"
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="email / snipe id"
android:digits="abcdefghijklmnopqrstuvwxyz.@0123456789"
android:textAllCaps="false"
android:textSize="12sp"
android:layout_marginLeft="-4dp"
android:textColor="@color/lightgray"
android:textColorHint="@color/primary"/>
</com.example.viveka.snipeid.CustomTextInputLayout>
我需要将两个字段更改为相同的颜色..
【问题讨论】:
-
你好 user8367573,你可以试试我的方式。它可以使两个提示颜色相同。
-
嗨,KeLiuye 现在我更新了图像..
-
您必须在电子邮件行和密码行中添加
TextInputLayout。 -
您好 user8367573,我更新了
android:textColor="#FF0000"。它可以改变文字颜色。 -
那是工作解决方案:kotlin version
标签: android android-layout android-edittext android-textinputlayout