android - 文本输入布局设计有问题?
问题描述
标签提示颜色不起作用,我创建了 Bluesky 颜色,但仅适用于线性框,但标签不起作用。
<android.support.design.widget.TextInputLayout
android:id="@+id/til1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginStart="5dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="0dp"
android:layout_weight=".8"
android:textColorHint="@color/BlueSky"
app:boxStrokeColor="@color/BlueSky"
app:counterEnabled="true"
app:counterMaxLength="7"
app:errorEnabled="true"
app:hintEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/tid1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="9dp"
android:elevation="7dp"
android:hint="Test"
android:inputType="number|numberDecimal"
android:maxLength="7"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
mi构建gradle:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-
layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation'com.android.support.test.espresso:espresso-core:3.0.2'
}
我使用的是 android studio 3.4 版。
解决方案
输入布局上的标签颜色是项目的 colorAccent。如果您将此颜色更改为 BlueSky,您将看到您想要的。
<color name="colorAccent">#D81B60</color>
但也许还有另一种方法可以在不更改 colorAccent 的情况下设置此小部件的样式(因为其他小部件也使用此颜色)。
推荐阅读
- ios - 如何在 WebView Swift 中打开外部链接?
- scala - com.fasterxml.jackson.dataformat.xml.XmlMapper.coercionConfigDefaults() 上的 NoSuchMethodError
- vespa - 有没有办法使用 Vespa 在文档中创建不可变值
- css - Angular 8 中 ng-attr-style 的等价物是什么?
- python - 检查数组中多个元素的相等性
- kubernetes - 无法访问 Openshift 集群中的内部注册表
- outlook - 如何使用 Outlook 插件清单文件在 Outlook 邮件页面和 Outlook 日历页面中添加自定义按钮?
- rust - 如何在 Diesel 中指定多个数据库模式?
- javascript - Gatsby 网站,使用 Helmet 的首页请求中不提供脚本
- reactjs - 单一spa中不同环境的多个importmap.json