Xcode SWRevealViewController-后视图下的前视图
我正在使用库SWRevealViewController进行前视图和后视图查看,它可以正常工作。 问题是,当我点击菜单按钮时,后视图在导航栏下,前视图向右移动 是否可以锁定前视图并查看导航栏顶部的菜单 我的代码: 在Appdelegate中:Xcode SWRevealViewController-后视图下的前视图,xcode,menu,swrevealviewcontroller,Xcode,Menu,Swrevealviewcontroller,我正在使用库SWRevealViewController进行前视图和后视图查看,它可以正常工作。 问题是,当我点击菜单按钮时,后视图在导航栏下,前视图向右移动 是否可以锁定前视图并查看导航栏顶部的菜单 我的代码: 在Appdelegate中: UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window = window; UIStoryboard
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window = window;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
SplashScreenViewController *splashScreenViewController = (SplashScreenViewController *)[storyboard instantiateViewControllerWithIdentifier:@"splash"];
UINavigationController *navControllerFront = [[UINavigationController alloc]initWithRootViewController:splashScreenViewController];
MenuNavigationViewController *menuViewController = (MenuNavigationViewController *)[storyboard instantiateViewControllerWithIdentifier:@"menu"];
UINavigationController *navControllerRear = [[UINavigationController alloc]initWithRootViewController:menuViewController];
SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:navControllerRear frontViewController:navControllerFront];
revealController.delegate = self;
self.viewController = revealController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
FrontView文件(不是splashscreen):
如何解决这个问题
非常感谢
编辑:我已经在“didFinishLaunchingWithOptions”方法中解决了这个问题
我对这个问题没有明确的答案,但我需要在我的项目中实现相同的功能 SWRevealController的作者坚持要有一种实现此功能的方法。我还在努力 链接是:
我想人们仍然无法准确地理解如何解决这个问题。你解决过这个问题吗?我添加了解决问题的代码(为我)嗨,你解决了这个问题吗?
SWRevealViewController *revealController = [self revealViewController];
[revealController panGestureRecognizer];
[revealController tapGestureRecognizer];
UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
[navController setNavigationBarHidden:NO animated:YES];
UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"menu.png"] style:UIBarButtonItemStylePlain target:revealController action:@selector(revealToggle:)];
revealButtonItem.image = [revealButtonItem.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
self.navigationItem.leftBarButtonItem = revealButtonItem;
SWRevealViewController *revealViewController = (SWRevealViewController *)self.window.rootViewController;
UINavigationController* navController = (UINavigationController*)revealViewController.frontViewController;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
NewSplashScreenViewController *start = (NewSplashScreenViewController *)[storyboard instantiateViewControllerWithIdentifier:@"splashnew"];
[navController setViewControllers: @[start] animated: YES];
[revealViewController setFrontViewController:navController];
[revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];