我正在使用新的 Google 设计库 (com.android.support:design:22.2.0),但我遇到了 android.support.design.widget.TextInputLayout 的问题。
如果我以编程方式设置它的 EditText, float 提示颜色是灰色而不是强调色。如果用户自己填写字段 (EditText) 或更改字段的预定义值,它会起作用。
这是我的代码:
<android.support.design.widget.TextInputLayout
android:layout_height="wrap_content"
android:layout_width="match_parent">
<EditText
android:id="@+id/register_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/register_username"
android:inputType="text"/>
</android.support.design.widget.TextInputLayout>
用户点击某个按钮后,它通过 EditText 的 setText() 方法填充字段, float 提示变为灰色。是错误还是我遗漏了什么?
最佳答案
将 android:textColorHint="@color/your_color"
放入 TextInputLayout
关于android - TextInputLayout 提示颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30589895/