React-Native Navigation不可见

时间:2017-07-14 06:02:25

标签: reactjs react-native react-navigation expo react-native-navigation

我已经将我的MainNavigator集成到所有导入的屏幕,而当我在ios模拟器上运行它时,它只显示白屏而没有其他任何内容。这意味着运行应用程序时没有任何错误。我不知道为什么导航不可见。 这是代码。

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { TabNavigator, DrawerNavigator, StackNavigator } from 'react-navigation';

import WelcomeScreen from './screens/WelcomeScreen';
import SigninScreen from './screens/SigninScreen';
import SignupScreen from './screens/SignupScreen';
import HomeScreen from './screens/HomeScreen';
import BusinessScreen from './screens/BusinessScreen';
import TechScreen from './screens/TechScreen';
import EducationScreen from './screens/EducationScreen';
import LifestyleScreen from './screens/LifestyleScreen';
import ProfileScreen from './screens/ProfileScreen';
import FavoritesScreen from './screens/FavoritesScreen';
import SettingsScreen from './screens/SettingsScreen';

export default class App extends React.Component {
  render() {
    const MainNavigator = TabNavigator({
      welcome: { screen: WelcomeScreen },
      signin: { screen: SigninScreen },
      signup: { screen: SignupScreen },
      main: {
        screen: DrawerNavigator({
          home: { screen: HomeScreen },
          business: { screen: BusinessScreen },
          tech: { screen: TechScreen },
          education: { screen: EducationScreen },
          lifestyle: { screen: LifestyleScreen },
          profile: {
            screen: StackNavigator({
              profile: { screen: ProfileScreen },
              settings: { screen: SettingsScreen },
            }),
          },
        }),
      },
    })
    return (
      <View style={styles.container}>
        <MainNavigator />
      </View>
    );
  }
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

以下是我在我的应用中使用的版本:

0 个答案:

没有答案