我MMdrawerController
用来在我的项目中练习侧抽屉控制器。但是当我点击左侧的菜单按钮,然后点击选择的行时,它打开得很好,但是相应的视图没有在视图的左侧显示菜单项(抽屉菜单按钮)。所以我无法做出任何进一步的选择。我使用故事板。
MydrawerController
我在抽屉的表格视图中浏览单元格的示例代码。
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self.delegate drawerMenuViewController:self didSelectMenuSection:indexPath.row];
switch ((MMDrawerMenuViewControllerSection)indexPath.row) {
case MMDrawerMenuViewControllerSectionProfile:
[self.mm_drawerController setCenterViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"MMProfileViewController"] withCloseAnimation:YES completion:nil];
break;
default:
break;
}
}
我的中心观点只是做这些:
-(void)setupLeftMenuButton{
MMDrawerBarButtonItem *leftDrawerButton=[[MMDrawerBarButtonItem alloc]initWithTarget:self action:@selector(leftDrawerButtonPress:)];
[self.navigationItem setLeftBarButtonItem:leftDrawerButton animated:YES];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)leftDrawerButtonPress:(id)sender{
[self.mm_drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];
}
-(void)doubleTap:(UITapGestureRecognizer*)gesture{
[self.mm_drawerController bouncePreviewForDrawerSide:MMDrawerSideLeft completion:nil];
}
我的另一个无法显示菜单项的视图控制器具有上面给出的相同按钮处理程序。但仍然没有显示菜单项。