0

我的左侧菜单取代了中心视图。它看起来比左菜单覆盖中心视图更糟糕。 解释 我如何配置它?

4

1 回答 1

0

//MMDrawerController

ViewController * centerViewController = [[ViewController alloc] init];
UINavigationController *centerNavigationController = [[UINavigationController alloc] initWithRootViewController:centerViewController];
ViewController *leftViewController = [[ViewController alloc] init];
UINavigationController *leftNavigationController = [[UINavigationController alloc] initWithRootViewController:leftViewController];
_drawerController = [[MMDrawerController alloc] initWithCenterViewController:centerNavigationController leftDrawerViewController:leftNavigationController];
[leftNavigationController setNavigationBarHidden:YES];
[centerNavigationController setNavigationBarHidden:YES];
[_drawerController setMaximumLeftDrawerWidth:300.0];
[_drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIColor * tintColor = [UIColor colorWithRed:29.0/255.0
                                      green:173.0/255.0
                                       blue:234.0/255.0
                                      alpha:1.0];
[self.window setTintColor:tintColor];
[self.window setRootViewController:_drawerController];
[self.window makeKeyAndVisible];
于 2015-10-28T02:15:30.327 回答