user1670469
user1670469

Reputation: 105

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?

Upvotes: 2

Views: 3114

Answers (2)

JKzidi
JKzidi

Reputation: 56

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)

Upvotes: 3

mani kandan
mani kandan

Reputation: 439

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.

Upvotes: 5

Related Questions