美文网首页
iOS MMDrawerController 侧滑push问题

iOS MMDrawerController 侧滑push问题

作者: 范迪ra | 来源:发表于2018-06-08 14:40 被阅读0次

    1.使用MMDrawer时push使用:

      DeviceViewController *device = [[DeviceViewController alloc] init];
      [self.navigationController pushViewController:device animated:YES];
    

    如下图所示无法push,原始是self.navigationController是null.


    Untitled.gif

    2.于是改成代码如下

    DeviceViewController *device = [[DeviceViewController alloc] init];
    RootTabController * tab  = (RootTabController*)self.mm_drawerController.centerViewController;
    RootNavController *nav = tab.viewControllers[0];
    [nav pushViewController:device animated:NO]; 
    [self.mm_drawerController closeDrawerAnimated:YES completion:^(BOOL finished) {
         [self.mm_drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeNone];
    }];
    

    会出现其他的tabbar无法Push.


    Untitled.gif

    3.后来检查发现是因为nav的问题,将代码改成:

    RootNavController *nav = tab.viewControllers[tab.selectedIndex];
    
    Untitled.gif

    相关文章

      网友评论

          本文标题:iOS MMDrawerController 侧滑push问题

          本文链接:https://www.haomeiwen.com/subject/zgfasftx.html