材料3主题无法使用暗模式打开

发布于 2025-02-06 15:13:16 字数 303 浏览 1 评论 0原文

我正在学习Android开发,并尝试使用theme.material3.daynight。当我处于光模式时,它成功地主题是按钮和其他视图,但是当我使用Android系统切换到黑暗模式时,所有主题都将恢复为正常。最大的放弃是按钮从椭圆形到矩形。 我发现有趣的是them.material3.darktheme.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文