我在项目中使用了DrawerLayout,但是我不想让用户在某些页面中打开抽屉,因此找不到禁用它的选项。有什么把戏吗?
这是我的代码的一部分:
return (
<DrawerLayout
drawerWidth={300}
ref="drawer"
renderNavigationView={() => navigationView}>
<Router hideNavBar={true}>
<Schema name="default" sceneConfig={Navigator.SceneConfigs.FloatFromRight}/>
<Route initial={true} name="empty" component={Empty}/>
<Route name="login" component={Login} onLoginSuccess={()=>{this.onLoginSuccess()}}/>
<Route name="pages">
<Router footer={Footer} header={Header} hideNavBar={true}>
<Route name="issues" initial={true} component={Issues} title={"123"}/>
<Route name="analytics" component={Analytics} title={"456"}/>
</Router>
</Route>
</Router>
</DrawerLayout>
);
在0.22.0-rc中有一个新的proporLockerMode模式,它可以锁定抽屉。
http://facebook.github.io/react-native/releases/0.22/docs/drawerlayoutandroid.html#drawerlockmode
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句