sld*_*ldk 2 react-native react-redux react-native-router-flux
我正在使用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>
);
Run Code Online (Sandbox Code Playgroud)
我需要根据当前场景的状态动态地打开/关闭导航栏。
自述文件说:
高度可定制的导航栏 - 根据场景甚至场景的状态显示/隐藏导航栏(例如,编辑/保存导航栏用于编辑模式)。
我没有找到任何详细的说明。任何人都可以请提供建议或提供示例链接吗?
谢谢!
从自述文件:
Actions.refresh(PARAMS)将更新当前屏幕的属性。
要以编程方式更新安装的场景,您只需执行以下操作:
Actions.refresh({key: 'yourSceneKey', hideNavBar: true});
Run Code Online (Sandbox Code Playgroud)
随意放置任何其他道具,例如,您还可以使用此刷新功能更改场景的标题。
| 归档时间: |
|
| 查看次数: |
4308 次 |
| 最近记录: |