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.

[Android 6.0+] StatusBar translucent={true} doesn't works

See original GitHub issue

I’ve found a problem: on Android 6.0+ status bar doesn’t renders as it must with translucent={true} enabled. On Android 4.4+ and Android 5.0+ it works as expected.

Here is my status bar code:

<StatusBar
 animated={true}
 barStyle={barStyle}
 backgroundColor={backgroundColor}
 translucent={true}
 showHideTransition={'fade'}
/>

Tested on: RN 0.31.0 Google Nexus 5x (Android 6.0) Google Nexus 4 (Android 5.0) Meizu MX (Android 4.4.4)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
mehcodecommented, Aug 16, 2016

To follow up – I also have no problems with translucent in Android 6.x / RN 0.31.0


@alexHlebnikov To try and understand where @nihgwu and I differ from you, how do you use <StatusBar/> ?

I have a single <StatusBar /> component that is rendered near the root view as

<StatusBar translucent backgroundColor="rgba(255, 255, 255, 0)" />

I use a borderTop to give a color under the statusBar depending on the needs of the scene.

2reactions
alexHlebnikovcommented, Aug 19, 2016

Yep, it worked! Huge thanks for help guys!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Completely transparent Status Bar? - Stack Overflow
I used the code and then added an image as background and then added android:fitsSystemWindows="true" to my activity_main.xml. The system bars are translucent...
Read more >
Display content edge-to-edge in your app | Android Developers
Button modes: The system applies a translucent scrim behind the system bars (for API level 29 or higher) or a transparent system bar...
Read more >
Android: Full Screen UI with Transparent Status Bar
This article talks about how to make the status bar transparent in any Android app. Also, it deals with how to make a...
Read more >
Styling the StatusBar in React Native, Expo and ... - Aamnah
Set translucent on the status bar to make it behave consistently on iOS and Android. Doing so will make your life easier. Not...
Read more >
Why would I want to fitsSystemWindows? | by Ian Lake - Medium
That's what the default behavior of the android:fitsSystemWindows="true" ... which needs to span the whole screen and appear under a transparent status bar....
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