React Navigation default background color

前端 未结 6 1237
春和景丽
春和景丽 2021-01-02 16:45

I\'m using react-navigation and stack-navigator to manage my screens.

Platforms I\'m using:

  • Android
  • React Native: 0.47.1
  • React Naviga
6条回答
  •  天涯浪人
    2021-01-02 17:45

    With react-navigation v3.x You can use the transparentCard pro:

    const MainNavigator = createStackNavigator(
      {
        BottomTabs: {
          screen: BottomTabsStack,
        },
        Modal: {
          screen: ModalScreen,
        }
      },
      {
        headerMode: 'none',
        mode: 'modal',
        transparentCard: true,
        cardStyle: { opacity: 1 } //This prop is necessary for eventually issue.
      }
    );
    

    You can find a complete example below:

    https://snack.expo.io/@cristiankmb/stacks-in-tabs-with-header-options-with-modal

提交回复
热议问题