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

617
Visualizações
facing problem in changing status bar color in jetpack compose

I have two activities in my app, one is the home.kt and another is the about.kt, for both screens I have different background color, in the home.kt file I set the status bar color to background color.

rememberSystemUiController().setStatusBarColor(
    MaterialTheme.colors.background, darkIcons = MaterialTheme.colors.isLight
)

When I move to about.kt I again tried to match its color to background but the status bar keeps its original color which was set in home.kt

rememberSystemUiController().setStatusBarColor(
    MaterialTheme.colors.surface, darkIcons = MaterialTheme.colors.isLight
)
//This piece is having no effect
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

In each activity, instead of using:

rememberSystemUiController().setStatusBarColor,

set the statusbar color like this:

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            ComposePlaygroundTheme {
                window?.setStatusBarColor(Color.Red.toArgb())
            }
        }
    }
}
over 4 years ago · Santiago Trujillo Relatório

0

For that, too google has created a library called accompanist. You can find it here: https://github.com/google/accompanist

like in this module have multiple module for jetpack compose, system controller so you can change by using it

for more understanding see the document :-- https://google.github.io/accompanist/systemuicontroller/

over 4 years ago · Santiago Trujillo 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