1. <tfoot id='RNeuF'></tfoot>

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

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

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

      Expo Android 从底部选项卡导航器切换到材料顶部选项卡导航器时出现白色闪烁

      时间:2023-11-29
        <i id='6AnSw'><tr id='6AnSw'><dt id='6AnSw'><q id='6AnSw'><span id='6AnSw'><b id='6AnSw'><form id='6AnSw'><ins id='6AnSw'></ins><ul id='6AnSw'></ul><sub id='6AnSw'></sub></form><legend id='6AnSw'></legend><bdo id='6AnSw'><pre id='6AnSw'><center id='6AnSw'></center></pre></bdo></b><th id='6AnSw'></th></span></q></dt></tr></i><div id='6AnSw'><tfoot id='6AnSw'></tfoot><dl id='6AnSw'><fieldset id='6AnSw'></fieldset></dl></div>

        <small id='6AnSw'></small><noframes id='6AnSw'>

      1. <legend id='6AnSw'><style id='6AnSw'><dir id='6AnSw'><q id='6AnSw'></q></dir></style></legend>

            <tbody id='6AnSw'></tbody>

              <tfoot id='6AnSw'></tfoot>

              • <bdo id='6AnSw'></bdo><ul id='6AnSw'></ul>
                本文介绍了Expo Android 从底部选项卡导航器切换到材料顶部选项卡导航器时出现白色闪烁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                从底部标签导航器切换到顶部标签导航器时出现白色闪烁

                这个白色闪烁在这个 gif 之外更加明显.但是我正在使用 Expo 管理的 React Native 项目,当我从底部选项卡导航器切换到顶部选项卡导航器时,屏幕会闪烁白色.此问题仅发生在 Android 上.最重要的是,当您按下 TextInput 打开键盘时,在键盘动画发生时键盘占用的部分中的屏幕变为白色.这是我在 App.js 中的导航器

                This white flicker is much more noticeable outside of this gif. But I am using an Expo managed React Native project and when I switch from my Bottom tab navigator to my Top tab navigator the screen flickers white. This issue only occurs on Android. On top of that, when you press a TextInput to open the keyboard, the screen turns white in the section the keyboard takes up while the keyboard animation is occuring. Here are my navigators in App.js

                const AuthTabs = createMaterialTopTabNavigator();
                const AuthStackScreen = () => (
                      <AuthTabs.Navigator tabBarOptions={options}>
                          <AuthTabs.Screen name="Sign In" component={SignInScreen} />
                          <AuthTabs.Screen name="Sign Up" component={SignUpScreen} />
                      </AuthTabs.Navigator>
                    );
                

                const Tab = createBottomTabNavigator();
                  const MainStack = () => (
                    <Tab.Navigator>
                      <Tab.Screen name="Deals" component={DealsStackScreen} />
                      <Tab.Screen name="Categories" component={CategoriesStackScreen} />
                      <Tab.Screen name="My Account" component={MyAccountStackScreen} />
                    </Tab.Navigator>
                

                  const RootStack = createStackNavigator();
                  const Root = () => (
                      <RootStack.Navigator headerMode="none" cardStyle={{opacity: 1}} >
                          <RootStack.Screen name="Home" component={MainStack}/>
                          <RootStack.Screen name="Auth" component={AuthStackScreen}/>
                      </RootStack.Navigator>
                  );
                

                    return (
                      <AuthContextProvider>
                        <NavigationContainer theme={{ colors: {background: `${Colors.surface}` }}}>
                          <Root />
                        </NavigationContainer>
                      </AuthContextProvider>
                    );
                

                我尝试将我的主题颜色添加到 NavigationContainer 但这并没有解决问题.链接还显示了正在发生的事情的 GIF.

                I tried adding my theme color to the NavigationContainer but this did not fix the issue. Also link shows the GIF of what is happening.

                推荐答案

                是的,你必须将你的 RootStack 包裹在一个 View 周围,以 backgroundColor 作为主题的 backgroundColor

                Yes, you have to wrap your RootStack around a View with backgroundColor as theme's backgroundColor

                您的 RootStack 现在看起来像这样

                Your RootStack would look something like this now

                import { useTheme } from '@react-navigation/native';
                
                ... 
                
                const { colors } = useTheme();
                
                const RootStack = createStackNavigator();
                
                const Root = () => (
                  <View style={{ flex:1, backgroundColor: colors.background }}> // This is the catch..Also it needs flex:1
                    <RootStack.Navigator headerMode="none" cardStyle={{ opacity: 1 }}>
                      <RootStack.Screen name="Home" component={MainStack} />
                      <RootStack.Screen name="Auth" component={AuthStackScreen} />
                    </RootStack.Navigator>
                  </View>
                );
                

                这篇关于Expo Android 从底部选项卡导航器切换到材料顶部选项卡导航器时出现白色闪烁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在服务器上托管 Python 并从 React Expo App 调用 下一篇:在世博会打开相机

                相关文章

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

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

                  • <bdo id='XUnUk'></bdo><ul id='XUnUk'></ul>
                  <legend id='XUnUk'><style id='XUnUk'><dir id='XUnUk'><q id='XUnUk'></q></dir></style></legend>
                  1. <tfoot id='XUnUk'></tfoot>