Android: 如何查看所有TextAppearance样式

Android: how to see all TextAppearance styles

我正在尝试设置我的登录表单的样式,但是我无法将输入的背景设为白色。

@android:style/TextAppearance.DeviceDefault.Inverse 有效,因为它显示输入标题的颜色为白色;但是,对于提示文本,它仍然是黑色的。

有没有办法让我一次看到各种文字外观样式,而不是一个一个地尝试每一种样式?我注意到有一个很长的定义样式列表,但我无法将它们一起查看以进行比较。

<android.support.design.widget.TextInputLayout
                 android:id="@+id/textinputlayout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="15dp"
                 android:layout_marginRight="15dp"
                 android:layout_marginTop="40dp"
                 app:hintTextAppearance="@android:style/TextAppearance.DeviceDefault.Inverse">

                 <android.support.design.widget.TextInputEditText
                     android:id="@+id/nameEdit"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:hint="User Name" />

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

尝试在 TextInputEditText 中添加这个

android:textColorHint="@color/yourColor"

你可以这样做。

更改 TextInputLayoutLEFT-TOP 文本颜色

app:hintTextAppearance="@style/text_in_layout_hint_Style"

样式代码

<style name="text_in_layout_hint_Style">
    <item name="android:textColor">#FF0000</item>
</style>

您可以在 .java 中完成此操作。

textInputLayout.setHintTextAppearance(R.style.text_in_layout_hint_Style);