如何解决《使用MMDrawerConroller如何禁用旋转是一些ViewControllers?》经验,请问有什么解决方案? 我在我的应用程序中使用MMDrawerController从这个链接我在AppDelegate中设置了根ViewController: s
我在我的应用程序中使用MMDrawerController从这个链接我在AppDelegate中设置了根ViewController:
self.leftDrawerCOntroller= [[LeftDrawerViewController alloc] init]; self.homeViewCOntroller= [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil]; self.navigatiOnController= [[UINavigationController alloc] initWithRootViewController:self.homeViewController]; // DrawerViewController setup self.drawerCOntroller= [[MMDrawerController alloc] initWithCenterViewController:self.navigationController leftDrawerViewController:self.leftDrawerController]; [self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll]; [self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll]; [self.drawerController setDrawerVisualStateBlock:^(MMDrawerController *drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) { MMDrawerControllerDrawerVisualStateBlock block; block = [[DrawerVisualStateManager sharedManager] drawerVisualStateBlockForDrawerSide:drawerSide]; if (block) { block(drawerController, drawerSide, percentVisible); } }]; [self.window setRootViewController:self.drawerController];我想在特定的ViewController中禁用旋转,我调用这些方法,它们永远不会被调用,视图仍然会旋转:
// ViewController.m-(BOOL)shouldAutorotate { return NO;}- (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait;}我想问题来自rootViewController,这是MMDrawerViewController!我已经检查这个和这个和这个,但没有任何帮助.
【文章转自韩国站群多ip服务器 http://www.558idc.com/krzq.html处的文章,转载请说明出处】