2012-02-19 129 views
4

我想創建一個自定義SEGUE交換ViewControllers用捲縮的動畫,但我不能找到一種方法,會是什麼 - 這個(無效)執行?定製Segue公司與UIViewAnimationOptionTransitionCurlDown

我有了這個

-(void)perform{ 
    UIViewController *dst = [self destinationViewController]; 
    UIViewController *src = [self sourceViewController];  
    [UIView beginAnimations:nil context:nil]; 
    //change to set the time 
    [UIView setAnimationDuration:1]; 
    [UIView setAnimationBeginsFromCurrentState:YES]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:src.view cache:YES]; 
    [UIView commitAnimations]; 
} 

但我沒有得到改變看法,反正感謝您的幫助!

回答

3

沒關係,我解決了這個問題,備案,我不得不做的唯一的事情是添加導航控制器,然後我可以使用自定義塞格斯像:

- (void) perform { 
    UIViewController *src = (UIViewController *) self.sourceViewController; 
    UIViewController *dst = (UIViewController *) self.destinationViewController; 
    [UIView transitionWithView:src.navigationController.view duration:0.3 
         options:UIViewAnimationOptionTransitionFlipFromBottom 
        animations:^{ 
         [src.navigationController pushViewController:dst animated:NO]; 
        } 
        completion:NULL]; 
}