使用UISplitViewController进行iOS页面转换

时间:2012-08-25 00:58:25

标签: ios animation uisplitviewcontroller uisplitview

我想在UISplitView中设置页面过渡动画。我正在使用的代码是......

NSUInteger row = indexPath.row;

    UIViewController <SubstitutableDetailViewController> *detailViewController = nil;



if (row == 0) {
    FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc] initWithNibName:@"FirstDetailView" bundle:nil];
    detailViewController = newDetailViewController;
}

if (row == 1) {
    SecondDetailViewController *newDetailViewController = [[SecondDetailViewController alloc] initWithNibName:@"SecondDetailView" bundle:nil];
    detailViewController = newDetailViewController;
}

NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
splitViewController.viewControllers = viewControllers;
[viewControllers release];

if (popoverController != nil) {
    [popoverController dismissPopoverAnimated:YES];
}

if (rootPopoverButtonItem != nil) {
    [detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
}

[detailViewController release];

我该怎么做?感谢..

1 个答案:

答案 0 :(得分:2)

使用UIPageViewController作为拆分视图的详细视图控制器。它支持页面动画和过渡。