Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
dark mode interfering with background color

I'm trying to apply background colors to my app and for some reason I can't get the right colors

for example:

<View style={{backgroundColor:'yellow'}}></View>

but I'm getting

enter image description here enter image description here

the first one in system dark mode and second one in light mode ( settings & phone model )

so how do I get consistent colors in any mode?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I'm not quite sure if I understand you right. But I assume you don't want your App to be able to force dark mode right? Some of our users with the same Redmi Phone you mentioned also had the problem with forced dark mode which made the appearance pretty ugly.

If so, add the item 'forceDarkAllowed' set to false inside your /android/app/src/main/res/values/styles.xml

<resources>
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <item name="android:windowBackground">@drawable/launch_screen_bitmap</item>
    <item name="android:forceDarkAllowed">false</item>
about 4 years ago · Juan Pablo Isaza Report

0

You should not hardcode the color like this. try to use color dynamically based on the light or dark theme.

Use the package like this :

react-native-appearance

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!