gpt4 book ai didi

react-native - 在 react-native-router-flux 中以编程方式隐藏导航栏

转载 作者:行者123 更新时间:2023-12-04 05:15:21 24 4
gpt4 key购买 nike

我正在使用 react-native-router-flux .

我知道可以使用 hideNavbar 显示/隐藏每个场景的导航栏在相应的场景中,如下所示:

const scenes = Actions.create(
<Scene key="root">
<Scene key="main" component={mainComponent} initial={true} hideNavBar={true}/>
<Scene key="secondary" component={secondaryComponent} hideNavBar={false} />
</Scene>
);

我需要根据当前场景的状态动态打开/关闭导航栏。

自述文件说:

Highly Customizable Navigation Bar - Show/hide the navbar depending on Scene or even the state of a Scene (e.g. Edit/Save navbar for edit mode).



不过,我没有找到任何详细的说明。任何人都可以请建议或提供一个示例的链接吗?

谢谢!

最佳答案

来自 Readme :

Actions.refresh(PARAMS) will update the properties of the current screen.



要以编程方式更新已安装的场景,您只需执行以下操作:
Actions.refresh({key: 'yourSceneKey', hideNavBar: true});

随意将任何其他 Prop 放在那里,例如,您还可以使用此刷新功能更改场景的标题。

关于react-native - 在 react-native-router-flux 中以编程方式隐藏导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43769212/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com