I want to be able to swipe between these two screens smoothly. I'm using a createBottomTabNavigator(), is that possible or should I use a different navigator?
To achieve smooth swiping between screens, you should use a createMaterialTopTabNavigator rather than createBottomTabNavigator. The createMaterialTopTabNavigator is designed for a more fluid swipe experience.
Here is how you can adjust your code:
First, install the necessary libraries if you haven't already:
Navigator Change: Replaced createBottomTabNavigator with createMaterialTopTabNavigator.
ScreenOptions: Adjusted to ensure no header, and customize the indicator and tint colors.
Tab Icons: Added tabBarIcon to retain the icons within the tabs for a more consistent UI.
Custom Add Button: This pattern presumes IconButton is a custom component you've defined.
Note:
createMaterialTopTabNavigator doesn't support a tabBarButton out-of-the-box for adding custom buttons like createBottomTabNavigator. You'll need to find an alternative approach for the "Add Post" screen. One way might be to add it as a floating action button (FAB) outside of the tab navigator.