我在我的项目中实现了MFSideMenu
。它工作得很好,但唯一的问题是当我在屏幕上向右滑动时它会被打开。需要禁用它。
我必须实现滑动手势来推动和弹出控制器。
navigation=[[UINavigationController alloc]initWithRootViewController:viewCtrl];
navigation.navigationBar.barTintColor = [UIColor colorWithRed:72.0/255.0 green:144.0/255.0 blue:226.0/255.0 alpha:1];
SideMenuViewController *leftMenuViewController = [[SideMenuViewController alloc] init];
container.panMode = 0;
container = [MFSideMenuContainerViewController
containerWithCenterViewController:navigation
leftMenuViewController:leftMenuViewController
rightMenuViewController:nil];
self.window.rootViewController=container;
答案 0 :(得分:2)
在viewWillAppear中添加此行可解决此问题
[self.menuContainerViewController setPanMode:MFSideMenuPanModeNone];
答案 1 :(得分:0)
使用它可以为我工作:
SideMenuViewController *leftSideMenuController = [[SideMenuViewController alloc] init];
UINavigationController *navigationController = [self navigationController];
UINavigationController *leftnavigationController = [[UINavigationController alloc] initWithRootViewController:leftSideMenuController];
if (!sideMenu)
{
sideMenu = [MFSideMenu menuWithNavigationController:navigationController
leftSideMenuController:leftnavigationController
rightSideMenuController:nil];
}
sideMenu.menuSlideAnimationEnabled = NO;
leftSideMenuController.sideMenu = sideMenu;
sideMenu.panMode=MFSideMenuPanModeNavigationController;
return sideMenu;