<tfoot id='rLKak'></tfoot>
    <bdo id='rLKak'></bdo><ul id='rLKak'></ul>
    <legend id='rLKak'><style id='rLKak'><dir id='rLKak'><q id='rLKak'></q></dir></style></legend>

    1. <small id='rLKak'></small><noframes id='rLKak'>

      1. <i id='rLKak'><tr id='rLKak'><dt id='rLKak'><q id='rLKak'><span id='rLKak'><b id='rLKak'><form id='rLKak'><ins id='rLKak'></ins><ul id='rLKak'></ul><sub id='rLKak'></sub></form><legend id='rLKak'></legend><bdo id='rLKak'><pre id='rLKak'><center id='rLKak'></center></pre></bdo></b><th id='rLKak'></th></span></q></dt></tr></i><div id='rLKak'><tfoot id='rLKak'></tfoot><dl id='rLKak'><fieldset id='rLKak'></fieldset></dl></div>

        升级到 expo SDK 37.0.0 后,我的 stackNavigator 标头高度增加了一倍

        时间:2023-11-29

        <small id='bARGt'></small><noframes id='bARGt'>

            <bdo id='bARGt'></bdo><ul id='bARGt'></ul>

              <tfoot id='bARGt'></tfoot>
            1. <legend id='bARGt'><style id='bARGt'><dir id='bARGt'><q id='bARGt'></q></dir></style></legend>

                    <tbody id='bARGt'></tbody>
                  <i id='bARGt'><tr id='bARGt'><dt id='bARGt'><q id='bARGt'><span id='bARGt'><b id='bARGt'><form id='bARGt'><ins id='bARGt'></ins><ul id='bARGt'></ul><sub id='bARGt'></sub></form><legend id='bARGt'></legend><bdo id='bARGt'><pre id='bARGt'><center id='bARGt'></center></pre></bdo></b><th id='bARGt'></th></span></q></dt></tr></i><div id='bARGt'><tfoot id='bARGt'></tfoot><dl id='bARGt'><fieldset id='bARGt'></fieldset></dl></div>
                • 本文介绍了升级到 expo SDK 37.0.0 后,我的 stackNavigator 标头高度增加了一倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  "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 后,我的标题栏高度增加了一倍,我无法恢复正常.

                  I am facing very weird issue. My stackNavigator header is too high. After upgrading to expo 37.0.0 my header bar doubled in height and I cannot return it to normal.

                  这是我的 stackNavigator 代码:

                  Here is my code for 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,
                    },
                  });
                  

                  它的外观如下:

                  即使我将高度设置为 0,标题仍然可见:

                  The header is still visible even if I set the height to 0:

                  附言标头为红色以提高可见度.

                  p.s. header is red for better visibility.

                  推荐答案

                  在导航选项中使用以下道具解决了我的问题:

                  Using the following prop in the navigation options fixed the issue for me:

                   navigationOptions: {
                              headerForceInset: { vertical: 'never' },
                          }
                  

                  根据我对 react-navigation docs 的理解,它创建了一个应用内容周围的 SafeAreaView 组件,但我仍然不知道为什么它会在顶部创建这个烦人的小栏.

                  From what I understood from react-navigation docs it creates a SafeAreaView component around the app's content, however why does it create this annoying small bar on the top is still unknown to me.

                  这篇关于升级到 expo SDK 37.0.0 后,我的 stackNavigator 标头高度增加了一倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何将图像 URI 转换为字节博览会 下一篇:Promise allSettled 不是函数

                  相关文章

                  <tfoot id='vRqWv'></tfoot>

                  <i id='vRqWv'><tr id='vRqWv'><dt id='vRqWv'><q id='vRqWv'><span id='vRqWv'><b id='vRqWv'><form id='vRqWv'><ins id='vRqWv'></ins><ul id='vRqWv'></ul><sub id='vRqWv'></sub></form><legend id='vRqWv'></legend><bdo id='vRqWv'><pre id='vRqWv'><center id='vRqWv'></center></pre></bdo></b><th id='vRqWv'></th></span></q></dt></tr></i><div id='vRqWv'><tfoot id='vRqWv'></tfoot><dl id='vRqWv'><fieldset id='vRqWv'></fieldset></dl></div>
                  1. <small id='vRqWv'></small><noframes id='vRqWv'>

                    • <bdo id='vRqWv'></bdo><ul id='vRqWv'></ul>
                  2. <legend id='vRqWv'><style id='vRqWv'><dir id='vRqWv'><q id='vRqWv'></q></dir></style></legend>