mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
fix: remove top margin when header is hidden in native stack. fixes #131
This commit is contained in:
@@ -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>
|
||||
);
|
||||
})}
|
||||
@@ -55,7 +68,6 @@ const styles = StyleSheet.create({
|
||||
content: {
|
||||
flex: 1,
|
||||
backgroundColor: '#eee',
|
||||
marginTop: Platform.OS === 'android' ? 56 : 0,
|
||||
},
|
||||
scenes: {
|
||||
flex: 1,
|
||||
|
||||
Reference in New Issue
Block a user