错误信息:
今天尝试添加FloatingActionButton的时候,修改了默认的背景,结果导致:
Caused by: Android.view.InflateException: Binary XML file line #204: Error inflating class android.support.design.widget.FloatingActionButton
解决方法:
将
android:backgroundTint="@color/colorPrimary"
换成
app:backgroundTint="@color/colorPrimary"
解决错误。
本文介绍了一个关于 FloatingActionButton 的常见错误:当尝试自定义背景颜色时出现 InflateException。文章详细解释了解决该问题的方法:正确使用 app 命名空间而非 android 命名空间。
480

被折叠的 条评论
为什么被折叠?



