From e68e664277b234771605864e0d0e97a9cc2ba608 Mon Sep 17 00:00:00 2001 From: rikochet Date: Tue, 28 Aug 2018 06:32:17 +0200 Subject: [PATCH] Add StatusBar marginTop for navTransparent (#3212) 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. --- src/navigationStore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/navigationStore.js b/src/navigationStore.js index fcf0b0991..b6e21722b 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -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, @@ -326,7 +326,7 @@ function createNavigationOptions(params) { if (navTransparent) { res.headerTransparent = true; - res.headerStyle = {}; + res.headerStyle = { marginTop: StatusBar.currentHeight }; } if (backToInitial) {