【发布时间】:2015-03-06 08:43:35
【问题描述】:
我正在使用 SWRevealViewController 构建一个滑动菜单。在访问菜单之前,会显示一个登录视图以允许用户登录。现在我想让用户断开连接并再次显示登录视图。我的问题是如何弹出 SWRevealViewController。
在登录后提供对应用程序的访问的代码是:
MainViewController *vMainMenu = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
vMainMenu.strURL = URL;
LeftMenu *vLeftMenu = [[LeftMenu alloc] initWithNibName:@"LeftMenu" bundle:nil];
UINavigationController *principalNavController = [[UINavigationController alloc] initWithRootViewController:vMainMenu];
UINavigationController *rearNavController = [[UINavigationController alloc] initWithRootViewController:vLeftMenu];
SWRevealViewController *mainRevealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavController frontViewController:principalNavController];
mainRevealController.delegate = self;
self.viewController = mainRevealController;
principalNavController.navigationBar.hidden = YES;
rearNavController.navigationBar.hidden = YES;
self.window.rootViewController = self.viewController;
此解决方案不起作用:
[self.revealViewController.navigationController popViewControllerAnimated:YES];
Splash *vSplash = [[Splash alloc] initWithNibName:@"Splash" bundle:nil];
[self.navigationController pushViewController:vSplash animated:YES];
你能帮帮我吗
谢谢。
【问题讨论】:
-
您的问题解决了吗?
-
是的,我做到了。但这并不是最好的解决方案,我禁用了 panGestureRecognizer 和 tapGestureRecognizer 然后我推送了 splashScreen: [self.revealViewController.navigationController popViewControllerAnimated:YES]; [revealController panGestureRecognizer].enabled = NO; [revealController tapGestureRecognizer].enabled = NO;
-
我尝试弹出它,但它只显示一个空白屏幕。无论如何我都会尝试你的解决方案。谢谢。
标签: ios slidingmenu swrevealviewcontroller popviewcontrolleranimated