English 中文(简体)
当Iavigate to the new Stack Screen in signo pathr时,我怎么躲藏在以前的Stack头脑?
原标题:How do I hide the previous Stack header when I navigate to the new Stack screen in expo router?

使用权宜之计,并想知道我如何从屏幕上删除先前的帽子,替代方法并不像预期的那样发挥作用。

我的档案结构就是这样:

-app
 -exercise
   -layout.tsx
   -index.tsx
   -Active.tsx
 -layout.tsx

页: 1

服饰/支出

<Stack>
  <Stack.Screen
    name="index"
    options={{
      headerShown: false,
      presentation: "modal",
    }}
  />
  <Stack.Screen
    name="Active"
    options={{
      headerShown: true,
    }}
  />
</Stack>

目前:

当我回家时,我就做过一次工作,我拿到工作指数。

router.navigate(`/exercise`); 

当这一指数上下一米时,我开始报到,Im被送至/exercise/Active.tsx。

router.replace({
          pathname: "exercise/Active",
        });

when I m on the exercise/Active, I get two stack screens on top, the exercise and the active enter image description here

What I want: when I m on the active screen, I don t want the exercise header to be shown, I know how to remove the Active header by simply adding "headerShow:false" in the exercise/layout Stack, but how do I remove the exercise header, which exists on the app/layout.

我可以把头盔推倒在演习布局上,因为当Im在评估/指数屏幕上排出头盔时,我只想去掉,当我上下台时,我从主动屏幕上排出一米,而我则想把头盔/前列车带走。

问题回答

我是这样说的,我认为我会回答这个问题,因为我感到,这对刚刚从 app开始的人来说是一个共同的问题。

The trick here is to set headerShown for the exercise Line on the app/layout to false and on the app/exercise/layout set the headerShown for the index to real and add a HeaderTitle "exercise”.

这将产生预期的结果。

在你看来,你可能会有 st。 如果是的话。 这隐藏在你工作台上的所有屏幕上(申请/翻译/投递)。

<Stack> 

  <Stack.Screen name="exercise" options={{headerShown: false}} /> 

  <Stack.Screen name="index" /> 

</Stack>

如果你在你的 app/lay中拿不住脚,那就用了一种.子,并且会解决这个问题。

So something like this

const Layout = () => {
   return <Slot />
}




相关问题
HandleClick not being recognized as a prop

I m trying to get my menu to show when I click the sidebar, but I m getting an error "react-dom.development.js:86 Warning: React does not recognize the handleClick prop on a DOM " import { ...

Is there an equivalent to localStorage in React Native?

I d like to implement the equivalent to the javascript localStorage in my React Native app. But I m unsure how to set. To function how I want it to, I would like the localStorage to be stored every ...

Video Calling in Expo React Native Application

I am building a React Native Application using Expo and I want to integrate a 1:1 video calling functionality in the app. From what I have researched so far on the topic is that I can use SDKs of ...

热门标签