android material-components

时间:2018-05-13 03:50:56

标签: material-components

我是Android材质组件的新手,我刚刚尝试了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>

1 个答案:

答案 0 :(得分:0)

这是素材库的alpha版本中的一个错误,其中背景是在文本顶部绘制的。它将在下一个版本中修复。