在反应原生的android和IOS的navgation-bar中的侧边菜单

时间:2016-02-16 09:21:45

标签: navigation react-native navigator

我试图在导航器中显示侧面菜单,我尝试使用NavigatorIOS它;在IOS中工作正常,但问题是与android为什么因为,组件NavigatorIOS不会在android这里编写代码我使用 NavigatorIOS

render(){
    return (
      <SideMenu ref="sidemenu" touchToClose={true} disableGestures={true} menu={<Menu getNavigator={this.getNavigator} showSideBar={this.showSideBar} LogOut={this.LogOut} data = {this.props.data}/>}>
          <NavigatorIOS
            ref = "nav"
            shouldUpdate={true}
            style={styles.container}
            barTintColor='#1A8A29'
            tintColor='white'
            titleTextColor='white'
            initialRoute={{
              component: MyProfile,
              title:'My Profile',
              passProps:{data:this.props.data},
              leftButtonIcon: require('image!menu1'),
              onLeftButtonPress: ()=> {this.showSideBar(); },
              rightButtonTitle: 'Log Out',
              onRightButtonPress: ()=> {this.LogOut();},
            }}
            />
      </SideMenu>
    );
  }

我想使用Navigator可以任何人给我建议如何使用Navigator in react-native写这个,任何帮助非常感谢

1 个答案:

答案 0 :(得分:0)

使用Navigator,而不是NavigatorIOS。核心ReactNative团队没有主动更新NavigatorIOS,也不像导航器那样灵活。