question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StatusBar styles can not be changed using StatusBar component

See original GitHub issue

This bug is related to StatusBar styles and the StatusBar styles while a Modal is opened. A big question with full details was made in StackOverflow, here. All these behaviors are related to Android.

Environment

  Expo CLI 2.2.5 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 9.10.1 - ~/.nvm/versions/node/v9.10.1/bin/node
      Yarn: 1.12.1 - ~/.yarn/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v9.10.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 9.2/9C40b - /usr/bin/xcodebuild
    npmPackages:
      expo: ^31.0.0 => 31.0.2
      react: 16.5.0 => 16.5.0
      react-native: https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz => 0.57.1
    npmGlobalPackages:
      expo-cli: 2.2.5

  Diagnostics report:
    https://exp-xde-diagnostics.s3.amazonaws.com/brodanoel-1689fffb-32a9-4d5a-aa39-e27405a290b9.tar.gz

App Target: Android

Steps to Reproduce

You’ll see that none of the changes that you did, were applied. It’s always translucent, and it have not backgroundColor on #FFF

Expected Behavior

  • The StatusBar should change the translucent and the background

Actual Behavior

  • The StatusBar doesn’t change (it’s always translucent and black). It doesn’t matter which prop you set, it never changes

I made a big StackOverflow question describing the whole issue and the whole expected and current behavior: https://stackoverflow.com/questions/53437241/react-native-modal-is-not-drawn-below-the-statusbar-on-android/53463180?noredirect=1#comment93797863_53463180

Reproducible Demo

Even you can open this another Snack that sets the StatusBar to translucent={false}, but it always is translucent. (the red view is drawn behind the StatusBar)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:31 (11 by maintainers)

github_iconTop GitHub Comments

14reactions
athenawisdomscommented, Aug 16, 2019

Experienced similar problem on Expo SDK 34 with iOS 12.4. No statusbar property is set in app.json.

Working:

  • StatusBar.setBarStyle
  • StatusBar.setHidden
  • <StatusBar hidden={true}>
  • <StatusBar barStyle='light-content'}>

Not Working:

  • StatusBar.setBackgroundColor
  • StatusBar.setTranslucent
  • <StatusBar backgroundColor='#000000'>

How did you guys get backgroundColor to work? @satya164

5reactions
brentvatnecommented, Mar 9, 2020

improvements are coming in sdk 37 with https://github.com/expo/expo/pull/6506

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS 16 Launch Screen status bar style cannot be changed to ...
I am able to reproduce this issue by creating a new project and attempting to change the status bar style. What am I...
Read more >
StatusBar - React Native
Component to control the app's status bar. The status bar is the zone, typically at the top of the screen, that displays the...
Read more >
StatusBar - Expo Documentation
Whether the app can draw under the status bar. When true , content will be rendered under the status bar. This is always...
Read more >
Different status bar configuration based on route
This is a simple task when using a stack. You can render the StatusBar component, which is exposed by React Native, and set...
Read more >
Customizing your React Native status bar based on route
We also have another option if you would rather not use the StatusBar component. The imperative API allows us to push various styles...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found