I'm writing an application using react-native, and I'm trying to show content behind status and navigation bars. I managed to solve this issue by adding some code styles.xml
. This managed to solve my issue, but I recently realized that It doesn't fully work on all devices. On my Pixel 6
running Android 12
the status and navigation bars are not fully transparent.
I tried many things that got suggested on Stack Overflow, but none of them fully worked. I even managed to get it working on a native android app, but writing the same code in a react-native app doesn't work.
This is the code that I currently have in my styles.xml
:
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:enforceStatusBarContrast" tools:targetApi="q">true</item>
<item name="android:enforceNavigationBarContrast" tools:targetApi="q">true</item>