Home > database >  Make my bottom navbar disapear when the keyboard is appearing React Native Navigation
Make my bottom navbar disapear when the keyboard is appearing React Native Navigation

Time:11-30

When i click on the bio part there is a keyboard opening up and when i click on it i want the bottom navbar to disapear how can i do it please ?

Red part should be invisible

The navbar in red part must disapear when the keyboard appears

thanks for you'r help

CodePudding user response:

Use keyboardHidesTabBar: true inside tabBarOptions it will hide bottom navigation bar when keyborad is open.

CodePudding user response:

Just be careful, that if you are using React Navigation 6x whole tabBaroptions prop was removed and options were renamed.

see docs below:

https://reactnavigation.org/docs/upgrading-from-5.x/#the-tabbaroptions-prop-is-removed-in-favor-of-more-flexible-options-for-bottom-tabs

keyboardHidesTabBar -> tabBarHideOnKeyboard

You have two options in your tab Navigator:

screenOptions => works for all screens inside navigator, no need to define options

<Tab.Navigator screenOptions={{tabBarHideOnKeyboard: true}}>
<Tab.Screen name={"my first screen"} /> 
<Tab.Screen name={"my second screen"} /> 
</Tab.Navigator>

options => works only for current screen

<Tab.Navigator>
<Tab.Screen name={"my first screen"} options={{tabBarHideOnKeyboard: true}}/> 
<Tab.Screen name={"my second screen"} /> 
</Tab.Navigator>
  • Related