【问题标题】:Background color issue of TextInputLayout in android material-componentsandroid材质组件中TextInputLayout的背景颜色问题
【发布时间】:2018-05-13 03:50:55
【问题描述】:

我是 android material-components 的新手,我只是第一次尝试了带有 FilledBox 样式的基本 TextInputLayout, 默认情况下,背景看起来像半透明,根据我们的设计,我需要将其更改为纯白色。但是我尝试了app:boxBackgroundColor="#ffffff",然后文字和文字提示变得不可见! 然后我尝试了 app:boxBackgroundColor="#80ffffff" 我可以看到它们是某种透明的。 你知道为什么?我只想要纯白色背景并保持其他人相同。

提前致谢!

<com.google.android.material.textfield.TextInputLayout
 style=".MaterialComponents.TextInputLayout.FilledBox"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:layout_marginTop="120dp"
 app:boxBackgroundColor="#ffffff">

    <com.google.android.material.textfield.TextInputEditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textColor="#ff000000"
        android:textColorHint="#ff0000"
        android:hint="Location"/>
</com.google.android.material.textfield.TextInputLayout>

【问题讨论】:

  • 你想知道这个问题是否在接收设计支持库中得到解决

标签: material-components


【解决方案1】:

这是 Alpha 版材质库中的一个错误,其中背景绘制在文本之上。下个版本会修复。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-10
    • 2019-07-19
    • 2020-08-15
    相关资源
    最近更新 更多