2012-08-25 65 views
0

我想爲UISplitView中的頁面轉換創建動畫效果。我正在使用的代碼是...使用UISplitViewController進行iOS頁面轉換

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]; 

我該怎麼做?謝謝..

回答

2

使用UIPageViewController作爲分割視圖的詳細視圖控制器。它支持頁面動畫和轉換。

相關問題