1
我在React Native应用程序中使用React Native Router Flux(https://github.com/aksonov/react-native-router-flux)进行路由。在React Native中隐藏导航栏
我想隐藏一些视图的导航栏,但不是为其他人。是否有捷径可寻?
我在React Native应用程序中使用React Native Router Flux(https://github.com/aksonov/react-native-router-flux)进行路由。在React Native中隐藏导航栏
我想隐藏一些视图的导航栏,但不是为其他人。是否有捷径可寻?
是的,有一些方法可以做到这一点。
举例来说,您有两个场景,并且您希望在匹配场景时隐藏导航栏。
根据RNRF文档,你可以使用hideNavBar
属性下导航栏
https://github.com/aksonov/react-native-router-flux/blob/master/docs/API_CONFIGURATION.md
基本的代码示例将这个样子
<Scene key="app">
<Scene key="sceneOne" component={ComponentOne} title="SceneOne" />
<Scene key="sceneTwo" hideNavBar={true} component={ComponentTwo} title="SceneTwo" />
</Scene>
注意,在 “SceneTwo” 我们使用hideNavBar={true}