Skip to content

Instantly share code, notes, and snippets.

@sezeresim
Created May 29, 2020 21:26
Show Gist options
  • Save sezeresim/ab721a8f0bd6140a7c3ff0ff122f1538 to your computer and use it in GitHub Desktop.
Save sezeresim/ab721a8f0bd6140a7c3ff0ff122f1538 to your computer and use it in GitHub Desktop.
//TabBarNavigation
const TabNavigation = () => {
return (
<Tab.Navigator
screenOptions={({route}) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
if (route.name === 'Home') {
iconName = focused ? 'ios-search' : 'ios-search';
} else if (route.name === 'More') {
iconName = focused ? 'ios-albums' : 'ios-albums';
} else if (route.name === 'Profile') {
iconName = focused ? 'ios-person' : 'ios-person';
}
return <Ionicons name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: 'black',
inactiveTintColor: 'gray',
}}>
<Tab.Screen
name="Home"
component={HomeScreen}
options={{
tabBarLabel: 'Keşfet',
}}
/>
<Tab.Screen
name="More"
component={AccountScreen}
options={{
tabBarLabel: 'Bana Özel',
}}
/>
<Tab.Screen
name="Profile"
component={ProfileScreen}
options={{
tabBarLabel: 'Profil',
}}
/>
</Tab.Navigator>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment