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
网友评论