顶部栏路由

2018-11-07  本文已影响0人  理想三旬_d066

import { createTabNavigator } from "react-navigation";

import FetchListDemo from "./FetchListDemo";

import My from "./My";

import Detail from "./Detail";

const Route = createTabNavigator(

  {

    FetchListDemo: {

      screen: FetchListDemo,

      navigationOptions: {

        title: "首页"

      }

    },

    My: {

      screen: My,

      navigationOptions: {

        title: "我的"

      }

    },

    Detail: {

      screen: Detail,

      navigationOptions: {

        title: "详情"

      }

    }

  },

  {

    //设置标题栏通配效果

    navigationOptions: {

      title: "标题"

    },

    tabBarPosition: "top", //Tab摆放位置

    //谁设置文本选中前后效果颜色

    tabBarOptions: {

      activeTintColor: "white", //激活样式

      inactiveTintColor: "gray" //未激活样式

    },

    swipeEnabled: true, //是否可以滑动

    animationEnabled: true //滑动效果

  }

);

export default Route;

上一篇下一篇

猜你喜欢

热点阅读