反应本机底部标签栏消失

时间:2020-01-23 14:32:17

标签: react-native expo tabbar tabnavigator

我在一个项目上工作了几个月,突然,我的标签栏消失了……我真的不明白为什么,我没有修改这个特定文件,并且软件包的更新与这个软件包无关。 ..

我认为它可能会发生变化,所以我尝试使用createMaterialBottomTabNavigator,但是它也不起作用,所以我真的不知道哪里出了问题...

如果您有任何线索,我可以在哪里进行搜索以使它起作用的任何想法可以帮助我吗?非常感谢您的时间和帮助。

import React from "react";
import { Image, StyleSheet, Text, View } from "react-native";
import { createBottomTabNavigator } from "react-navigation-tabs";
import { createAppContainer } from "react-navigation";
const HomeTab = createStackNavigator(
  {
    Account: Account
  },
  {
    defaultNavigationOptions: {
      headerStyle: {
        backgroundColor: "#0091EA"
      },
      headerTintColor: "#fff",
      title: "Account"
    }
  }
);

const SettingsTab = createStackNavigator(
  {
    Settings: Settings
  },
  {
    defaultNavigationOptions: {
      headerStyle: {
        backgroundColor: "#0091EA"
      },
      headerTintColor: "#FFFFFF",
      title: "Settings"
    }
  }
);
const StatsTab = createStackNavigator(
  {
    Stats: Stats
  },
  {
    defaultNavigationOptions: {
      headerStyle: {
        backgroundColor: "#0091EA"
      },
      headerTintColor: "#FFFFFF",
      title: "Stats"
    }
  }
);
const MainApp = createBottomTabNavigator(
  {
    Account: {
      screen: Account,
      navigationOptions: {
        tabBarLabel: i18n.t("tabbar.action.account"),
        tabBarIcon: ({ focused, horizontal, tintColor }) => {
          return (
            <Image
              source={require("../../assets/images/profil.png")}
              style={{ width: 20, height: 20 }}
            />
          );
        }
      }
    },
    Statistics: {
      screen: Stats,
      navigationOptions: {
        tabBarLabel: i18n.t("tabbar.action.statistics"),
        tabBarIcon: ({ focused, horizontal, tintColor }) => {
          return (
            <Image
              source={require("../../assets/images/stats.png")}
              style={{ width: 20, height: 20 }}
            />
          );
        }
      }
    },
    Subscription: {
      screen: Subscription,
      navigationOptions: {
        tabBarLabel: i18n.t("tabbar.action.subscription"),
        tabBarIcon: ({ focused, horizontal, tintColor }) => {
          return (
            <Image
              source={require("../../assets/images/creditcard.png")}
              style={{ width: 20, height: 20 }}
            />
          );
        }
      }
    },
    Settings: {
      screen: Settings,
      navigationOptions: {
        tabBarLabel: i18n.t("tabbar.action.settings"),
        tabBarIcon: ({ focused, horizontal, tintColor }) => {
          return (
            <Image
              source={require("../../assets/images/settings.png")}
              style={{ width: 20, height: 20 }}
            />
          );
        }
      }
    }
  },
  {
    initialRouteName: 'Account',
    tabBarOptions: {
      activeTintColor: "#FF6F00",
      inactiveTintColor: "#263238"
    }
  }
);

export default createAppContainer(MainApp);

0 个答案:

没有答案
相关问题