在我的 build.gradle 中,我包含了 Material 设计库(版本 1.1.0),但在 styles.xml
中, 当我尝试使用 Theme.MaterialComponents.DayNight
,上面写着 cannot resolve symbol
. Material 设计库 1.1.0 中不是已经实现了 DayNight 主题吗?请帮忙。谢谢。
最佳答案
使用最新版本
implementation 'com.google.android.material:material:1.2.0-alpha03'
样式.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
关于android - Theme.MaterialComponents.DayNight 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59495906/