tabnavigator

How to navigate in a screen which is not defined because of a variable?

人盡茶涼 提交于 2021-02-11 12:19:21
问题 When I am in the login screen I would like once the user logs in that it is also redirected to the 'Home' screen but currently, I have an error telling me that the Home is not defined what is normal ... {isAuth ? ( <BottomTab.Screen name='Home' component={Home} /> ): ( <> <BottomTab.Screen name='Connexion' component={Login} /> <BottomTab.Screen name='Inscription' component={Register} /> </> I don't really know how to use contexts yet but I think it might simplify the thing but in the meantime

How to change the color of the active / selected tab?

北城以北 提交于 2021-02-08 05:21:33
问题 I want the color to be the default gray color when the tab is not selected but to be my tabBarColor color when the tab is selected. I could not find a way to change the color of the title in the tab bar. How can I do that? This is my code: Home:{ screen: TabNavigator({ Home: { screen: HomeScreen, navigationOptions: ({ navigation }) => ({ title: 'Home', tabBarIcon: ({ tintColor, focused }) => ( <Ionicons name={focused ? 'ios-home' : 'ios-home-outline'} size={26} style={{ color: focused ? `$

Change bottom border color of selected tab bar item

大兔子大兔子 提交于 2021-02-06 20:02:05
问题 I have the following code in react-native import React, {Component} from 'react'; import {TabNavigator} from 'react-navigation'; import {View} from 'react-native'; class Home extends Component { static navigationOptions = { title:'Home', tabBarLabel:'First' }; render() { return <View></View>; } } const tabOptions = { tabBarOptions: { activeTintColor:'white', inactiveTintColor:'#D3D3D3', style:{ backgroundColor:'green', borderTopWidth:1, borderTopColor:'#D3D3D3' }, tabBarSelectedItemStyle: {

Change bottom border color of selected tab bar item

天大地大妈咪最大 提交于 2021-02-06 20:00:52
问题 I have the following code in react-native import React, {Component} from 'react'; import {TabNavigator} from 'react-navigation'; import {View} from 'react-native'; class Home extends Component { static navigationOptions = { title:'Home', tabBarLabel:'First' }; render() { return <View></View>; } } const tabOptions = { tabBarOptions: { activeTintColor:'white', inactiveTintColor:'#D3D3D3', style:{ backgroundColor:'green', borderTopWidth:1, borderTopColor:'#D3D3D3' }, tabBarSelectedItemStyle: {

TabNavigator extra padding

别说谁变了你拦得住时间么 提交于 2021-01-23 04:53:16
问题 How to style the TabNavigator Tab's height and padding? Im doing the following: import Icon from "react-native-vector-icons/MaterialIcons"; const tabNav = TabNavigator({ TabItem1: { screen: MainScreen, navigationOptions: { tabBarLabel:"Home", tabBarIcon: ({ tintColor }) => <Icon name={"home"} size={20} color={tintColor} /> } }, TabItem2: { screen: MainScreen, navigationOptions: { tabBarLabel:"Home", tabBarIcon: ({ tintColor }) => <Icon name={"home"} size={30} color={tintColor} /> } },

Have a stack navigator always render initialRoute

放肆的年华 提交于 2020-07-10 10:18:27
问题 I'm building a react native app and I'm using react-navigation package. I have a tab navigator for the app and each tab has a stack navigator in it. Something like this: const HomeStack = StackNavigation({ Info: {screen: Info}, Main: {screen: Main} }) const SearchStack = StackNavigation({ Search: {screen: Search}, SearchResult: {screen: SearchResult} }) TabNavigation({ Home: {screen: HomeStack}, Search: {screen: SearchStack} }) So let's say I did a search and I'm now on SearchResult screen. I

Hide TabBar item in TabNavigator

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-28 04:15:05
问题 How is it possible to hide certain TabBar item from TabNavigator. Is there a certain TabBarOptions option, which has visible key(true/false) like this? const Tabs = TabNavigator({ Home: { screen: Home }, Profile: { screen: Thanks, tabBarOptions: { visible: false }, }, More: { screen: More }, }) 回答1: There is not 'visible' option for hide specific item from TabNavigator. You need to create a Stacknavigator and a Tabnavigator. In the Stacknavigator you will add yours 'invisible' tabbar items

Block/Disable tabs in TabNavigator - react-navigation

筅森魡賤 提交于 2020-03-01 04:44:37
问题 I have a TabNavigator as shown in the picture. Header Image I am using TabNavigator for creating these tabs as below. const Tab_Navigator = TabNavigator({ First:{ screen: First, }, Second:{ screen: Second, }, Third:{ screen: Third, }, Now I want to block/disable "Second" and "Third" tabs. It should be visible but one shouldn't able to navigate to them. I tried blocking these tabs as shown here but I guess I am missing something. My try: Tab_Navigator.router.getStateForAction = (action, state)

Multiple Tab fragments inside bottom navigation fragment

自古美人都是妖i 提交于 2019-12-31 08:32:55
问题 In bottom navigation with three tabs (Home, Dashboard, Notifications). Each bottom navigation tab is a fragment. The first tab ie. Home fragment contains another top navigation tabs having four tabs (Tab 1, Tab 2, Tab 3, Tab 4). The problem When navigate from Home tab to Notifications tab directly and come back to Home tab, Tab1/which ever tab previously selected tab (top navigation tabs) the content of the tab is not loaded. When swipe the tabs from Tab 1 (Home fragment tab) all the way to

Multiple Tab fragments inside bottom navigation fragment

末鹿安然 提交于 2019-12-31 08:32:30
问题 In bottom navigation with three tabs (Home, Dashboard, Notifications). Each bottom navigation tab is a fragment. The first tab ie. Home fragment contains another top navigation tabs having four tabs (Tab 1, Tab 2, Tab 3, Tab 4). The problem When navigate from Home tab to Notifications tab directly and come back to Home tab, Tab1/which ever tab previously selected tab (top navigation tabs) the content of the tab is not loaded. When swipe the tabs from Tab 1 (Home fragment tab) all the way to