material-components - android材质组件中TextInputLayout的背景颜色问题
问题描述
我是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>
解决方案
这是材质库的 alpha 版本中的一个错误,其中背景绘制在文本之上。它将在下一个版本中修复。
推荐阅读
- codenameone - CodenameOne:与 3.x 版本相比,DialogBody 在 CodenameOne 4.x 中留下了太多空间
- php - 如何管理 .env 文件以便在 laravel 中以联系方式接收电子邮件?
- c# - C# 从文本文件中读取并添加到字符串数组
- jquery - 使用 jQuery 计数器进行指导
- javascript - 必须单击带有角度的单击事件两次才能完成操作
- python - '__neg__' 实现。我正在学习python中的魔术方法
- reactjs - 显示 Axios 响应 - TypeError: this.state.cryptos.map is not a function
- swift - 如何获得具有键盘/鼠标焦点的 Mac OS X 应用程序的显示范围?
- react-native - React Native Router Flux Drawer
- css - 将 Bootstrap 4 添加到 Slate V1 - 在 Chrome 开发人员工具中获取两个索引