Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

220
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda