材料3主题无法使用暗模式打开
我正在学习Android开发,并尝试使用theme.material3.daynight
。当我处于光模式时,它成功地主题是按钮和其他视图,但是当我使用Android系统切换到黑暗模式时,所有主题都将恢复为正常。最大的放弃是按钮从椭圆形到矩形。 我发现有趣的是them.material3.dark
和theme.material3.light
工作正常。当然,当系统在黑暗和光模式之间切换时,它们不会切换,这就是为什么我要使用theme.material3.daynight
。
I'm learning android development and trying to use Theme.Material3.DayNight
. It successfully themes the buttons and other Views when I'm in light mode but when I switch to dark mode using my android's system all the theming reverts back to normal. The biggest give away is that the button goes from being an oval to a rectangle.
What I find interesting is that Theme.Material3.Dark
and Theme.Material3.Light
work just fine. Of course they don't switch when the system switches between dark and light mode, which is why I want to use Theme.Material3.DayNight
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论