顶部栏路由
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;