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

V3 Transparent screen background

Open creative-git opened this issue 7 years ago • 4 comments

i need to display a loading animation on top of splash screen, so i thought about creating a transparent screen , but "backgroundColor: "transparent" doesn't work . and the screen has a white background. any idea?

  Navigation.setRoot({
    root: {
      component: {
        name: "navigation.loading",
        id: "navigation.loading",
        options: {
          topBar: {
            visible: false,
            height: 0
          },
          layout: {
            backgroundColor: "transparent",
            orientation: ["portrait"]
          },
          screenBackgroundColor: "transparent",
          modalPresentationStyle: "overCurrentContext"
        }
      }
    }
  });

Environment

  • React Native Navigation version: V3
  • React Native version: 0.60.4
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): ALL

creative-git avatar Aug 18 '19 10:08 creative-git

You probably want to show that component in an https://wix.github.io/react-native-navigation/#/docs/top-level-api?id=showoverlaylayout-.

guyca avatar Aug 19 '19 05:08 guyca

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 Detox and report back. Thank you for your contributions.

stale[bot] avatar Sep 18 '19 06:09 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Sep 25 '19 06:09 stale[bot]

Is it possible at all to set backgroundColor in setRoot?

This doesn't work:

Navigation.setRoot({
    root: {
        stack: {
          children: [{
            component: {
              name: 'Welcome',
              passProps: {
                text: 'stack with one child'
              }
            }
          }],
          options: {
            topBar: {
              visible: false,
            },
            layout: {
              backgroundColor: 'red',
            },
          }
        }
      }
    });

This does work:


Navigation.setDefaultOptions({
  layout: {
    backgroundColor: '#3c1fa0',
  },
})

Navigation.setRoot({
    root: {
        stack: {
          children: [{
            component: {
              name: 'Welcome',
              passProps: {
                text: 'stack with one child'
              }
            }
          }],
          options: {
            topBar: {
              visible: false,
            },
          }
        }
      }
    });

GioLogist avatar Nov 22 '19 17:11 GioLogist