首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TextInputLayout标签颜色不变

TextInputLayout标签颜色不变
EN

Stack Overflow用户
提问于 2018-12-26 16:51:01
回答 1查看 474关注 0票数 1

我正在尝试更改textInputLayout标签/提示颜色。我看到它遵循colorPrimary,所以我应用了一个样式,在其中我设置了原色,但它不起作用。

我的xml-

代码语言:javascript
复制
<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:hint="hint"
    style="@style/Text"
    >
    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/edittext"/>
</com.google.android.material.textfield.TextInputLayout>

我的风格-

代码语言:javascript
复制
<style name="Text" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
        <item name="android:colorPrimary">@color/white</item>
        <item name="boxStrokeColor">@color/white</item>

我的布局

EN

回答 1

Stack Overflow用户

发布于 2018-12-27 13:28:43

新的材质库有点令人困惑。到目前为止,在com.google.android.material:material:1.1.0-alpha02中,textColorHint不起作用,但hintTextApperance起作用了,这必须是一种可以定义文本属性的样式。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53929631

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档