Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android平台 react-navigation tab之内的导航没问题,tab之外使用MapView导航返回,直接返回到桌面了 #831

Open
Astronomy-fhh opened this issue Aug 4, 2024 · 2 comments

Comments

@Astronomy-fhh
Copy link

以下是个简化后的例子,Map2里有MapView

从Feed里跳转到Map2,正常

重点:从Map2返回,直接返回到桌面了,不会返回到Feed

如果删除掉Map2里的MapView,从Map2返回到Feed就正常了

求解答,困扰很久了,实在不知道从哪入手

function Feed({ navigation }) {
  return (
    <View style={styles.container}>
      <Text>Feed Screen</Text>
      <Button
        title="Go to Map2"
        onPress={() => navigation.navigate('Map2')}
      />
    </View>
  );
}

function Home() {
  return (
    <Tab.Navigator>
      <Tab.Screen name="Feed" component={Feed} />
      <Tab.Screen name="Search" component={Search} />
    </Tab.Navigator>
  );
}


function Route() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen
          name="Home"
          component={Home}
          options={{headerShown: false}}
        />
        <Stack.Screen name="Map2" component={Map2} />
        <Stack.Screen name="Settings" component={Settings} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}
@Keizai
Copy link

Keizai commented Aug 13, 2024

可能是crash了

@Keizai
Copy link

Keizai commented Aug 13, 2024

try this #821 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants