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.

Backdrop doesn't cover the StatusBar (Android)

See original GitHub issue

Environment

System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 1.75 GB / 15.82 GB
  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.1
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Disabled
      Versions: 10.0.17763.0
  IDEs:
    Android Studio: Version  4.1.0.0 AI-201.8743.12.41.6953283
    Visual Studio: Not Found
  Languages:
    Java: 1.8.0_275 - C:\Program Files\OpenJDK\openjdk-8u275-b01\bin\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: 0.64.3 => 0.64.3
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Platforms

Android

Versions

  • Android:
  • iOS:
  • react-native-modal: 13.0.0
  • react-native: 0.64.3
  • react: 17.0.1
  • expo: 44.0.5

Description

On Android the Backdrop doesn’t cover the StatusBar.

271918180_354675636484632_5253943028790051611_n

I already checked within my code and the Modal is implemented outside ReactNavigation or SafeAreaView (Which could add some safespace). Since I am on expo, I cannot implement The backdrop is not completely filled/covered on some Android devices (Galaxy, for one) (Du to react-native-extra-dimensions-android). I tried a workaround by using useSafeAreaFrame, useSafeAreaInsets from react-native-safe-area-context but that doesn’t seem to have any impact.

I checked on IOS and everything works as expected :

272048832_543555289945854_9151352767394767071_n

Reproducible Demo

https://snack.expo.dev/@alexis.regnaud/demo-react-native-modal

You should see on the snack that the statusbar is covered on IOS but not on Android

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

11reactions
souzaluizcommented, Feb 9, 2022

@rafmrs @alexis-regnaud I solve like this.

function Component () {
  return (
    <Modal 
      isVisible={true} 
      deviceHeight="100%"
      statusBarTranslucent
    >
      ....
    </Modal>
  );
}
4reactions
alexis-regnaudcommented, Feb 9, 2022

That code worked also :

const { height } = Dimensions.get('screen');

function Component () {
  return (
    <Modal 
      isVisible={true} 
      deviceHeight={height}
      statusBarTranslucent
    >
      ....
    </Modal>
  );
}

And this doesn’t cause any Type issue

I think in my case statusBarTranslucent was the props which was missed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backdrop doesn't cover Android navigation bar at the bottom
As the title said, if I hide the navigation bar at the bottom of the Android device, the Modal backdrop is clipped and...
Read more >
Status bar background stays on screen when entering ...
Hi your problem is caused by StatusBar nature, it has a separate layout from your main content and you need to ...
Read more >
Customizing your React Native status bar based on route
Learn to master status bars in React Native for any device by using the StatusBar component and the imperative API.
Read more >
React Native: Setting a Status bar background color ... - Medium
To change the Status bar background color on iPhone X, XS, XR +++, you need to use the SafeAreaView component by React Native....
Read more >
cordova-plugin-statusbar
Set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color...
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