2015-11-24 50 views
1

的滑動手勢在應用程序委託:如何禁用UINavigation控制器

- (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

您的科迪ng很好,你遇到了什麼問題。 –

回答

0

嘗試後[window makeKeyAndVisible]禁用interactivePopGestureRecognizer

到問題的關鍵是,interactivePopGestureRecognizer屬性爲nil,直到滿足兩個條件:

  1. 的navigationController被關聯到窗口

  2. 窗口成爲關鍵和可見

相關問題