react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

how to hide tabBar on scroll?

Open alpamys-qanybet opened this issue 9 years ago • 4 comments

how to hide tabBar on scroll?

I have set navBarHideOnScroll to true but I also want to hide tabBar(on bottom). Cannot find the right property to set if exists.

the result and what I want to do (hide navbar and tabbar on scroll)

result0want0

import {Platform} from 'react-native';
import {Navigation} from 'react-native-navigation';

import {registerScreens} from './src/screens';
import { iconsMap, iconsLoaded } from './src/app-icons';

registerScreens();


iconsLoaded.then(() => {
  startApp();
});

// this will start our app
function startApp() {
  const tabs = [{
    screen: 'example.Home',
    icon: iconsMap['ios-home'],
    title: 'Navigation Types',
  }, {
    screen: 'example.Favourite',
    icon: iconsMap['ios-heart'],
    topTabs: [{
      screenId: 'example.Favourite.TabOne',
      title: 'Избранные',
    }, {
      screenId: 'example.Favourite.TabTwo',
      title: 'Подписки',
    }],
  }, {
    screen: 'example.Post',
    icon: iconsMap['ios-add-circle']
  }, {
    screen: 'example.Message',
    icon: iconsMap['ios-mail']
  }, {
    screen: 'example.Profile',
    icon: iconsMap['ios-person']
  }];
  
  Navigation.startTabBasedApp({
    tabs,
    animationType: Platform.OS === 'ios' ? 'slide-down' : 'fade',
    tabsStyle: {
      tabBarBackgroundColor: '#fff',
      tabBarButtonColor: 'grey',
      tabBarSelectedButtonColor: '#4586e0',
      tabFontFamily: 'BioRhyme-Bold',

      // tabBarHideOnScroll: true, ?
      // topBarCollapseOnScroll: true ?
      // tabBarCollapseOnScroll: true ?
    },
    appStyle: {
      tabBarBackgroundColor: '#fff',
      navBarButtonColor: 'grey',
      tabBarButtonColor: 'grey',
      navBarTextColor: 'grey',
      tabBarSelectedButtonColor: '#4586e0',
      navigationBarColor: '#fff',
      navBarBackgroundColor: '#fff',

      tabBarCollapseOnScroll: true,
      navBarHideOnScroll: true,
      statusBarHideWithNavBar: true,

      statusBarColor: '#002b4c',
      tabFontFamily: 'BioRhyme-Bold',
    }
  });
}

Environment

  • React Native Navigation version: ^1.1.282
  • React Native version: 0.50.3
  • Platform(s) (Android): 6.0
  • Device info (Device. OS version. Debug): Meizu M5 Note, Android 6.0, Debug

alpamys-qanybet avatar Nov 21 '17 07:11 alpamys-qanybet

I'm assuming you'll have to detect the event yourself and use this:

https://wix.github.io/react-native-navigation/#/screen-api?id=toggletabsparams-

liamsheppard avatar Nov 27 '17 01:11 liamsheppard

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

stale[bot] avatar Jun 02 '18 11:06 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

stale[bot] avatar Jul 19 '18 08:07 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Jul 26 '18 09:07 stale[bot]