|
|
@@ -1,11 +1,49 @@
|
|
|
import React from 'react';
|
|
|
import { NavigationContainer } from '@react-navigation/native';
|
|
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
|
+import { createStackNavigator } from '@react-navigation/stack';
|
|
|
|
|
|
import Clock from './Clock'
|
|
|
import Profile from './Profile'
|
|
|
|
|
|
-const Tab = createBottomTabNavigator()
|
|
|
+// 创建底部 Tab 导航器
|
|
|
+const Tab = createBottomTabNavigator();
|
|
|
+
|
|
|
+// 创建堆栈导航器
|
|
|
+const Stack = createStackNavigator();
|
|
|
+
|
|
|
+/*
|
|
|
+// 创建 A 页面的堆栈导航器
|
|
|
+const AStack = () => {
|
|
|
+ return (
|
|
|
+ <Stack.Navigator>
|
|
|
+ <Stack.Screen name="A" component={AScreen} />
|
|
|
+ <Stack.Screen name="C" component={CScreen} options={{ tabBarVisible: true }} />
|
|
|
+ </Stack.Navigator>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+// 创建 B 页面的堆栈导航器
|
|
|
+const BStack = () => {
|
|
|
+ return (
|
|
|
+ <Stack.Navigator>
|
|
|
+ <Stack.Screen name="B" component={BScreen} />
|
|
|
+ <Stack.Screen name="D" component={DScreen} options={{ tabBarVisible: false }} />
|
|
|
+ </Stack.Navigator>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+const App: React.FC = () => {
|
|
|
+ return (
|
|
|
+ <NavigationContainer>
|
|
|
+ <Tab.Navigator>
|
|
|
+ <Tab.Screen name="A" component={AStack} />
|
|
|
+ <Tab.Screen name="B" component={BStack} />
|
|
|
+ </Tab.Navigator>
|
|
|
+ </NavigationContainer>
|
|
|
+ );
|
|
|
+};
|
|
|
+*/
|
|
|
|
|
|
export default function RNMain() {
|
|
|
return (
|