React Native:在 UI 顶部获取额外的灰色条

React Native: Getting Extra Grey Bar at the top of UI

我的代码仓库位于:

https://github.com/samrao2/manager-4

我的顶部有一个额外的灰色菜单栏,但不知道如何摆脱它。我的直觉是,这是因为我的 Router.js 文件中有一个额外的场景标签,但我必须按照推荐的解决方案将其放入以解决 this issue with this 解决方案。

现在我在所有屏幕的顶部("please login" 条上方)多了一个灰色条,有人有什么想法吗?

啊哈,udemy 课程....有点过时了。 React-Native-Router-Flux 现在基于 React-Navigation,因此您必须添加一个 Stack。不确定我的代码是不是 'best practice',但这会处理灰色条(它也难倒了我。)

  <Router sceneStyle={{ paddingTop: 0 }}>
    <Stack key="root" hideNavBar="true">
     <Scene key="auth">
        <Scene key="login" component={LoginForm} title="Please Login" />
        <Scene key="createUser" component={CreateUser} title="Create A New Account" />
        <Scene key="password" component={PasswordReset} title="Reset Your Password" />
  </Scene>
    <Scene key="main">
       <Scene
        onRight={() => Actions.employeeCreate()}
        rightTitle="Add"
        key="employeeList"
        component={EmployeeList}
        title="Employees"
        initial
       />
    </Scene>
  </Stack>
</Router>

我的授权密钥中还有几个场景,但你应该明白了。