1
我設置了一個導航控制器作爲分割視圖控制器的詳細視圖(NewFeedsNavigationController繼承自UINavigationController)。UINavigationController作爲UISplitViewController的詳細視圖
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
NewsFeedsNavigationController *newsFeedsNavigationController = [[NewsFeedsNavigationController alloc] initWithCategories];
splitViewController = [[UISplitViewController alloc] init];
masterViewController.splitViewController = splitViewController;
splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, newsFeedsNavigationController, nil];
splitViewController.delegate = newsFeedsNavigationController;
// Add the split view controller's view to the window and display.
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;
}
事實上,導航控制器在縱向方向上出色地工作,但在橫向方向上有點怪異。在層次結構中導航(朝向根視圖)時,我總是必須在每個視圖中點擊兩次。第一次點擊時,可見視圖從堆棧彈出,第二次點擊導航欄。通常,兩者同時發生。我不知道發生了什麼問題。