我无法在登录页面的 Android 应用程序中更改提示文本颜色。
<AutoCompleteTextView
android:id="@+id/email"
android:textColor="@color/white"
android:backgroundTint="@android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_email"
android:textColorHint="@android:color/white"
android:inputType="textEmailAddress"
android:maxLines="1" />
我使用了在许多其他在线示例中找到的 textColorHint 方法,但我不知道我正在做的事情有什么问题。
最佳答案
使用属性android:textColorHint="YOUR_COLOR"
设置提示文本颜色。
在您的 AutoCompleteTextView
中,您对 textColor
、backgroundTint
和 textColorHint< 使用
。确保您的 WHITE
颜色AutoCompleteTextView
背景颜色与 WHITE
不同。
这是一个AutoCompleteTextView
的工作示例。我使用了 RED
颜色作为 textColor
、GREEN
颜色 backgroundTint
和 BLUE
颜色textColorHint
。
<AutoCompleteTextView
android:id="@+id/email"
android:textColor="#FF0000"
android:backgroundTint="#00FF00"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Write something..."
android:textColorHint="#0000FF"
android:inputType="textEmailAddress"
android:maxLines="1" />
输出
希望对你有帮助~
关于java - 如何在 Android Studio 中更改提示文本颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43217751/