我是一个新来的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>发布于 2018-05-16 23:40:00
这是alpha版本的材质库中的一个错误,其中背景绘制在文本的顶部。这个问题将在下一个版本中修复。
https://stackoverflow.com/questions/50312615
复制相似问题