Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29452

React Native - React Navigation Tab Bar - Custom floating action button

$
0
0

I need some help to use React Native - react navigation library.It is Tab bar, but the Upload button acted as floating action button.

I have try :

const click = () => {  console.log('click');  return (<View><Text>a</Text></View>  );};tabBarOnPress: (tab) => {  click();},// Main Page Navigatorexport const Main = TabNavigator({  Home: {    screen: HomeNavigator,  },  Explore: {    screen: ExploreNavigator,  },  Upload: {    screen: UploadMain,    navigationOptions: ({ navigation }) => ({      tabBarLabel: 'Upload',      tabBarIcon: ({ tintColor }) => (<View><Icon name="camera" size={26} color={tintColor} /></View>      ),      tabBarOnPress: (tab) => {        click();      },    }),  },}, {  tabBarComponent: TabBarBottom,  tabBarPosition: 'bottom',  backBehavior: 'none',  swipeEnabled: false,  lazy: true,  animationEnabled: false,  showIcon: true,  tabBarOptions: {    activeTintColor: 'black',  },});

The Upload button is need to act as floating action button, when it clicked, it already logging, but not rendering the component.Any workaround to create the floating action button?

I've some tricks like this https://github.com/react-navigation/react-navigation/pull/1335

But, it is only click and dispatch navigation, not doing floating action button

Regards,Charlie


Viewing all articles
Browse latest Browse all 29452

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>