I am a student trying to learn app development with android studio. For my first project, im just building a basic calculator app. I have stumbled across a problem that I couldnt solve and didnt find a helpfull post about. It occurs when I trun on dark mode on the virtual device. Here are 2 pictures showing what happens.
My activity_main.xml consists of some buttons that all have the same style and a TextView.
I left all the other files untouched. Id love some advice on how to fix this. Thanks for reading!
2
Answers
You are most likely using the following default DayNight theme in your
themes.xml
file (values/themes/themes.xml)If you don’t want things to change in night mode, you can change that to use the Light theme instead
and delete the
themes.xml (night)
file if it exists. There is some extra info about these options herethere are two themes : night and not night check in IDE Design tab you can view how it looks in both click the circle in pane where design is displaying it displays Not Night and Night whatever theme you are using it will affect because of these two modes, by default IDE shows not night
To show screen same in both modes you need to change some settings like in your activity_main.xml at root layout change background to @color/white and see what happens it should be sorted out since your button colors are dark …the text Placeholder color needs to be changed accordingly