【发布时间】:2020-05-03 22:18:09
【问题描述】:
"expo": "^37.0.0",
"react-dom": "16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-navigation": "^4.0.9",
"react-navigation-drawer": "^2.3.3",
"react-navigation-stack": "^1.10.3",
"react-navigation-tabs": "^2.6.0"
我面临着非常奇怪的问题。我的 stackNavigator 标头太高。升级到 expo 37.0.0 后,我的标题栏高度增加了一倍,我无法恢复正常。
这是我的 stackNavigator 代码:
const DashboardStack = createStackNavigator(
{
DashboardDrawer: { screen: DashboardDrawerNavigator }
},
{
defaultNavigationOptions: ({ navigation }) => {
return {
headerStyle: {
backgroundColor: 'red',
// height: 1,
...Platform.select({
ios: {
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.2,
paddingTop: 0,
},
android: {
elevation: 3,
headerPressColorAndroid: '#111',
paddingTop: 0,
},
}),
},
headerTintColor: '#111',
headerTitleStyle: {
color: '#999',
},
headerLeftContainerStyle: {
},
headerLeft: (
<Icon
containerStyle={styles.burgerMenuIcon}
onPress={() => navigation.toggleDrawer()}
name="menu"
type="material-community"
size={30}
color={'#999'}
underlayColor={'#111'}
/>)
}
},
}
);
export default createAppContainer(DashboardStack);
const styles = StyleSheet.create({
burgerMenuIcon: {
paddingLeft: 20,
// paddingTop: 0,
// marginTop: 0,
},
});
附言标头为红色以提高可见度。
【问题讨论】:
-
我不确定更新是否存在问题,因为我正在使用 Expo SDK 36。您是否尝试过仅为 react-navigation 包恢复更新?
标签: javascript react-native react-navigation expo