Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status bar overlaps with app/nav bar #71

Closed
joshg111 opened this issue Mar 8, 2017 · 12 comments
Closed

Status bar overlaps with app/nav bar #71

joshg111 opened this issue Mar 8, 2017 · 12 comments

Comments

@joshg111
Copy link

joshg111 commented Mar 8, 2017

image

I don't get this problem when I am not using exponent.

@joshg111
Copy link
Author

joshg111 commented Mar 8, 2017

  1. RNRF for navigation. If I move to react-navigation will that possibly fix the issue?
  2. It seems there is no clash/overlap with bottom buttons, but I can't be sure.
  3. This is happening on a nexus 6 real device and genymotion emulator.
  4. It seems this happens even with example app.

@joshg111
Copy link
Author

joshg111 commented Mar 9, 2017

I found a statusBarHeight constant defined in exponent, so I just added this to the style object for the root component view:
marginTop: Exponent.Constants.statusBarHeight

Everything works fine now, but I would still like to know if this is the right approach. I still feel like I'm missing something here..

@halallahh
Copy link

same here. I also have this problem with CRNA

@terribleben
Copy link
Contributor

Hey there, sorry about the confusion. This is the correct solution for now. There is currently an issue in some navigation libraries where they do not detect whether the status bar is translucent or not. So the best practice at the moment is just to use Exponent.Constants.statusBarHeight yourself. Hopefully at some point the navigation libs get smarter about it.

@kunokdev
Copy link

Thanks for sharing I also want to mention that Expo.Constants.statusBarHeight is var name if imported like import Expo from 'expo'

@satya164
Copy link
Contributor

https://docs.expo.io/versions/v19.0.0/guides/configuring-statusbar.html

@artemik
Copy link

artemik commented Aug 18, 2017

@kunokdev Thanks. Expo documentation doesn't say where I should import those constants from. Guys, improve the docs.

@anilpatnik
Copy link

This should solve the problem

in app.json

"androidStatusBarColor": "#334393",
"androidStatusBar": {
"barStyle": "light-content",
"backgroundColor": "#334393"
}

@SupriyaKalghatgi
Copy link

@anilpatnik I have this in my app.json
Still, no help

@anilpatnik
Copy link

can I have your js code?

@recrsn
Copy link

recrsn commented Jan 25, 2018

@SupriyaKalghatgi and for others coming here with the same problem.

You should define this under the "expo" key like:

{
  "expo": {
    "sdkVersion": "23.0.0",
    "androidStatusBarColor": "#334393",
    "androidStatusBar": {
      "barStyle": "light-content",
      "backgroundColor": "#334393"
    }
  }
}

I use react-navigation with native-base, and it works fine

@rncrtr
Copy link

rncrtr commented Jan 11, 2019

Here is a more evergreen link explaining what you can/should do to fix this issue that should still work when the above link doesn't -- aka now and in the future:

https://docs.expo.io/versions/latest/guides/configuring-statusbar.html

@lock lock bot added the outdated label Jul 10, 2019
@lock lock bot locked and limited conversation to collaborators Jul 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants