Skip to content

Commit

Permalink
Add StatusBar marginTop for navTransparent (#3212)
Browse files Browse the repository at this point in the history
When using navTransparent feature, the headerStyle is removed causing the navbar to be obstructed by the Statusbar. 
This fix adds marginTop to the headerStyle to that the navbar is aligned below the StatusBar.
  • Loading branch information
rikochet authored and daviscabral committed Aug 28, 2018
1 parent f6d9d51 commit e68e664
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/navigationStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Image, Animated, Easing } from 'react-native';
import { StatusBar, Image, Animated, Easing } from 'react-native';
import {
createBottomTabNavigator,
createMaterialTopTabNavigator,
Expand Down Expand Up @@ -326,7 +326,7 @@ function createNavigationOptions(params) {

if (navTransparent) {
res.headerTransparent = true;
res.headerStyle = {};
res.headerStyle = { marginTop: StatusBar.currentHeight };
}

if (backToInitial) {
Expand Down

0 comments on commit e68e664

Please sign in to comment.