我以这种方式在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!
我已经检查了this和this以及this,但没有任何帮助.
-(BOol)shouldautorotate { return [self.topVIEwController shouldautorotate];}- (NSUInteger)supportedInterfaceOrIEntations { return [self.topVIEwController supportedInterfaceOrIEntations];}
我认为UINavigationController会自动控制,但万一你不能进行子类化.
总结以上是内存溢出为你收集整理的ios – 使用MMDrawerConroller如何禁用旋转是一些ViewControllers?全部内容,希望文章能够帮你解决ios – 使用MMDrawerConroller如何禁用旋转是一些ViewControllers?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)