我碰到这样的问题是由于我是用MaterialCardView时出现的,可能使用使用其他的Material库的控件时,也会出现这样的错误提示。这个错误就是说当前组件的主题是需要 Theme.MaterialComponents这样的主题。那么如何修改呢???
只需要在style.xml文件中,修改一下主题就可以了。
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
只需要换前面的就可以了,后面具体想要什么样的还是和之前一样的。
如果大家还有更好的解决办法,可以在评论留言交流哦!!!
本文地址:https://blog.csdn.net/qq_41677326/article/details/107892730
如对本文有疑问, 点击进行留言回复!!
Codeforces Round #662 (Div. 2) D. Rarity and New Dress
CodeForces 1393C Pinkie Pie Eats Patty-cakes
Codeforces Round #662 (Div. 2) A - Rainbow Dash, Fluttershy and Chess Coloring
网友评论