0
我掙扎在一個非常奇怪的情況:我創建了一個UISplitViewController
UISplitViewController創建程序沒有滑動手勢顯示/隱藏主
self.splitViewController = [[UISplitViewController alloc] init];
self.splitViewController.presentsWithGesture = YES;
UIViewController * master = [[UIViewController alloc] init];
master.view.backgroundColor = [UIColor yellowColor];
UINavigationController * navMaster = [[UINavigationController alloc] initWithRootViewController:master];
UIViewController * detail = [[UIViewController alloc] init];
detail.view.backgroundColor = [UIColor redColor];
UINavigationController * navDetail = [[UINavigationController alloc] initWithRootViewController:detail];
self.splitViewController.viewControllers = @[navMaster,navDetail];
self.window.rootViewController = self.splitViewController;
[self.window makeKeyAndVisible];
,但(在郵件應用程序等)的滑動手勢打開/顯示主視圖控制器不適用於iOS7,但適用於iOS8。如果我從主/細節模板創建一個新項目,該手勢起作用。但我需要以編程方式創建UISplitViewController
,因爲我必須在正常視圖控制器的登錄頁面後添加。我不想使用故事板,因爲在這個應用程序中會太大。