import React from “react”;
import { createBottomTabNavigator } from “react-navigation”;
import Ionicons from “react-native-vector-icons/Ionicons”;
import Publish from “./Publish”;
import My from “./My”;
import List from “./List”;
const Good = () => {
return <List tab=“good” />;
};
const BottomNav = createBottomTabNavigator(
{
Good: {
screen: Good,
navigationOptions: {
title: “帖子”
}
},
Publish: {
screen: Publish,
navigationOptions: {
title: “发布”
}
},
My: {
screen: My,
navigationOptions: {
title: “我的”
}
}
},
{
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
const { routeName } = navigation.state;
let iconName;
if (routeName === “Good”) {
//切换不同的图标
iconName = ios-document
;
} else if (routeName === “Publish”) {
iconName = ios-create
;
} else if (routeName === “My”) {
iconName = ios-person
;
}
return <Ionicons name={iconName} size={25} color={tintColor} />;
}
})
}
);
export default BottomNav;