在App代表中:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
WalkThrough *viewControllers=[[WalkThrough alloc]init];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewControllers];
[self.window setRootViewController:self.navigationController];
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
navigationController.navigationBar.hidden = YES;
self.window.backgroundColor = [UIColor clearColor];
[self.window makeKeyAndVisible];
return YES;
}
答案 0 :(得分:0)
尝试在 [window makeKeyAndVisible]
之后停用interactivePopGestureRecognizer 。
问题的关键是interactivePopGestureRecognizer
属性为nil
,直到 两者 满足两个条件:
navigationController与窗口
窗口变为关键且可见