【问题标题】:React Native Router Flux: drawer takes up entire pageReact Native Router Flux:抽屉占据整个页面
【发布时间】:2019-10-26 16:49:43
【问题描述】:

我想用 React Native Router Flux 实现一个抽屉。

这是我当前在 app.js 中的配置:

            <Router>
              <Stack key="root">
                <Scene key="fullApp"  component={fullApp} hideNavBar={true} />
                <Scene key="comments" component={Comment} hideNavBar={true} />
                <Scene key="createComment" component={CreateComment} hideNavBar={true} />
                <Scene key="playerPage"  component={PlayerPage} hideNavBar={true}/>
                <Scene key="saveFilter" animationEnabled={false} component={SaveFilter} hideNavBar={true}/>
                <Scene key="leagueSelect" gesturesEnabled={false} component={LeagueSelect} hideNavBar={true}/>
                <Scene key="filter" component={Filter} hideNavBar={true}/>
                <Drawer
                  hideNavBar
                  key="mainDrawer"
                  contentComponent={MainDrawer}
                  drawerWidth={250}
                  drawerPosition="right"
                  drawerIcon={drawerIcon}
                >
                  <Scene key="slide"  component={MainDrawer} hideNavBar={true}/>
                </Drawer>
              </Stack>
            </Router>

当我在另一个组件中调用Actions.mainDrawer() 时,抽屉打开了,但它占据了整个页面;就像是在打开一个场景,而不是一个抽屉。

【问题讨论】:

    标签: react-native react-native-router-flux


    【解决方案1】:

    你应该使用Actions.drawerOpen()打开你的抽屉

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多