我正在使用SWRevealViewController構建滑動菜單。在訪問菜單之前,會顯示登錄視圖以允許用戶登錄。現在我想讓用戶斷開並再次顯示登錄視圖。我的問題是如何彈出SWRevealViewController。Pop 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];
你能幫我請
謝謝。
您的問題是否解決? – ichanduu
是的,我做到了。但它不是最好的解決方案,我禁用了panGestureRecognizer和tapGestureRecognizer,然後我推了splashScreen: [self.revealViewController.navigationController popViewControllerAnimated:YES]; [revealController panGestureRecognizer] .enabled = NO; [revealController tapGestureRecognizer] .enabled = NO; –
我試着彈出它,它顯示的是一個空白的屏幕。無論如何,我會嘗試你的解決方案。謝謝。 – ichanduu