简体   繁体   English

深色主题未在我的 Android 应用程序中显示表值

[英]Dark theme not showing table values in my Android app

My Android app works well when the device is in light mode but when changed the dark mode, the table values no longer show.我的 Android 应用程序在设备处于亮模式时运行良好,但在更改暗模式时,表格值不再显示。

What may be wrong please?请问可能有什么问题?

Can you please be more specific (ie paste some code, using XML+Views or Compose, etc)您能否更具体一些(即粘贴一些代码,使用 XML+Views 或 Compose 等)

Could it be that the colour for the text in the tables is set to black and background is also black in dark mode?可能是表格中文本的颜色设置为黑色,而在暗模式下背景也是黑色吗? You may need to specify a colour for Text different than black.您可能需要为 Text 指定不同于黑色的颜色。

Check this post in case it helps: Android - Dark mode issue: black text on dark background如果有帮助,请查看此帖子: Android - 深色模式问题:深色背景上的黑色文本

I've discovered the issue.我发现了这个问题。 I used custom styling in my table layout and set the background color of the the custom table border to white.我在表格布局中使用了自定义样式,并将自定义表格边框的背景颜色设置为白色。 Hence, it was always white所以一直都是白色的

I have now resolved the issue by setting the color of the border to a "Theme" resource (sth like that) where I set it's value to black for light mode and white for dark mode我现在已经通过将边框的颜色设置为“主题”资源(类似的东西)解决了这个问题,我将它的值设置为黑色表示浅色模式,白色表示深色模式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM