Skip to content

Commit

Permalink
fix: remove top margin when header is hidden in native stack. fixes f…
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Oct 18, 2019
1 parent 3aaf6eb commit fb726ee
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/native-stack/src/views/StackView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,20 @@ export default function StackView({ state, navigation, descriptors }: Props) {
}}
>
<HeaderConfig {...options} route={route} />
<View style={[styles.content, contentStyle]}>{renderScene()}</View>
<View
style={[
styles.content,
{
marginTop:
Platform.OS === 'android' && options.headerShown !== false
? 56
: 0,
},
contentStyle,
]}
>
{renderScene()}
</View>
</Screen>
);
})}
Expand All @@ -55,7 +68,6 @@ const styles = StyleSheet.create({
content: {
flex: 1,
backgroundColor: '#eee',
marginTop: Platform.OS === 'android' ? 56 : 0,
},
scenes: {
flex: 1,
Expand Down

0 comments on commit fb726ee

Please sign in to comment.