Tab Navigator栏不会显示本机反应

时间:2017-11-17 03:38:14

标签: javascript react-native react-navigation

问题 我正在制作一个非常基本的应用程序,让用户发布,然后呈现帖子。我想添加一些标签,所以我添加了TabNavigator。我真的很困惑,因为当我运行应用程序时,我的屏幕上没有显示任何标签,我不知道为什么。我想我可能会遗漏一些东西,但我不知道是什么。我真的很想回应本地和firebase,我很乐意帮助解决这个问题。

代码

   import React, { Component } from 'react';
    import { StyleSheet, Text, View, Image, TextInput, ScrollView, TouchableHighlight, Button, FlatList } from 'react-native';
    import { Font } from 'expo';
    import * as firebase from 'firebase';
    import { TabNavigator } from 'react-navigation';

   //Removed code - some random variables

    export default class FeedView extends React.Component {
      static navigationOptions = {
        tabBarLabel: 'Home',
      };

     //Removed code - some more random variables

     render() {
static navigationOptions = {
    tabBarLabel: 'Home',
  };
        return (
          //Removed code - Code for this section
        );
    }



    class Comments extends React.Component {
      static navigationOptions = {
        tabBarLabel: 'Notifications',
      };
    render() {
static navigationOptions = {
    tabBarLabel: 'Comments',
  };
        return (
         //Removed code - This section's code
        );
      }
    }

   //Removed code - Styles declared here

    const MyApp = TabNavigator({
      Feed: {
        screen: FeedView,
      },
      CommentScreen: {
        screen: Comments,
      },
    }, {
      tabBarPosition: 'top',
      animationEnabled: true,
      tabBarOptions: {
        activeTintColor: '#fe8200',
      },
    });

0 个答案:

没有答案