android - edittext 中禁用文本的 android 默认颜色是什么?

标签 android android-edittext textcolor

我想将 EditText 中的提示颜色设置为禁用的文本颜色。所以我正在使用 android:textColorHint 属性。但我不知道该怎么做:

android:textColorHint="@android:color/???"     // what should I select?
//OR
android:textColorHint="?android:attr/???"      // what should I select?

编辑:我可以在值中定义相同的颜色,但我想引用它来处理 future 的变化。

最佳答案

你可以在文档中找到答案
https://material.google.com/style/color.html#color-text-background-colors

For dark text on light backgrounds, apply the following opacity levels:

The most important text has an opacity of 87%.
Secondary text, which is lower in the visual hierarchy, has an opacity of 54%.
Text hints (like those in text fields and labels) and disabled text have even lower visual prominence with an opacity of 38%.

关于android - edittext 中禁用文本的 android 默认颜色是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26954758/

相关文章:

android - OpenGL ES 2.0 通过共享 C++ 代码在 ios 和 android 上进行抗锯齿或平滑处理

android - 通过单击项目 View 并在 Android 应用程序中停止正在运行的文件来播放 MP3 音频文件

android - 为什么我要在没有代码的情况下调用 super

android - 如何防止滚动到聚焦的 EditText

类似于 Gmail 撰写屏幕的 Android EditText 布局

ios - 在 Swift 中更改 UITextView 的 textColor

android - ActionBar 自定义标题颜色

Android Linkify 链接 textColor 被忽略,css 样式是否可以覆盖?

java - 电话号码不对,使用 "ContactsContract"

java - 使 Android EditText 中的解析更容易