简体   繁体   中英

How to create a push down of screens in React Navigation

Is it possible to push down the whole navigation screen including the header? I need to push down my screen like the following image. Not sure where to start on accomplishing this. Will I need to nest my whole navigation inside another container?

下推示例

Yes you can wrap your navigator by another component like <View> and style it. Maybe it has some better solutions but wrapping is just fine and I did it before.

there is a built-in option for that - you need to set mode: 'modal' to your stack navigator, eg:

const MainStack = initialRouteName =>
  StackNavigator(
    {
...
    },
    {
      ...navStyles,
      initialRouteName,
      mode: 'modal',
    }
  );

note this will only have an effect on ios, because such pattern is not present on android

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM