简体   繁体   中英

my ionic app turned to a black background on android

I built my app, using the default "ionic start" command. I chose "blank" app and if I test on browser, background is white, but if I test the same blank app, on my android phone using "ionic cordova run android" the app background is black. Why?

Latest ionic update has theme related conflicts in latest android versions (not sure).
My solution-

  1. Open theme/variables.scss inside your project.
  2. Search for "dark" and you will find something like @media..dark ..
  3. Comment out the whole block related to dark .
  4. Open index.html and search 'light dark' . Remove the 'dark' and rebuild the app.
  5. Now your app uses correct colors .

I had the same problem and I solved it like this.

  1. Open theme/variable.scss
  2. Search @media (prefers-color-scheme: dark) and replace by @media (prefers-color-scheme: primary)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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