reset or change bottomTabNavigator text and route dynamically on scroll in react native

白昼怎懂夜的黑 提交于 2020-01-06 05:39:10

问题


I have created react native app with expo cli. I have a screen in which there is 6 section I just wanted to change the bottomTabNavigator for each section when scroll arrives at a particular section.

import React from 'react';
import { Platform } from 'react-native';
import { createStackNavigator, createBottomTabNavigator } from 'react-navigation';



const HomeStack = createStackNavigator(
  {
    Home: FlatListComponent,
  },
  config
);

HomeStack.navigationOptions = {
  tabBarLabel: 'Home',
  tabBarIcon: ({ focused }) => (
    <TabBarIcon
      focused={focused}
      name={
        Platform.OS === 'ios'
          ? `ios-information-circle${focused ? '' : '-outline'}`
          : 'md-information-circle'
      }
    />
  ),
};

HomeStack.path = '';



const menu = {
  HomeStack


}

const tabNavigator = createBottomTabNavigator(menu);

tabNavigator.path = '';

export default tabNavigator;

Example - This is happen when user scroll down or up

来源:https://stackoverflow.com/questions/58947420/reset-or-change-bottomtabnavigator-text-and-route-dynamically-on-scroll-in-react

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!