2016-06-14 235 views
0

我想從一個視圖控制器轉到另一個使用頁面捲曲動畫;但是當我的第二個控制器加載時,它隱藏了它的集合視圖。這是我的代碼:curlUp和curlDown從一個視圖控制器到另一個視圖的動畫

OffersVC *Offers = [[OffersVC alloc]init]; 
    Offers = [self.storyboard instantiateViewControllerWithIdentifier:@"Offers"]; 
    [UIView beginAnimations:@"flipview" context:nil]; 
    [UIView setAnimationDuration:2]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; 
    [self.view addSubview:Offers.view]; 

    [UIView commitAnimations]; 

回答

1

嘗試添加動畫如下檢查

UIView *mainview = self.view.window; 

OffersVC *Offers = [[OffersVC alloc]init]; 
Offers = [self.storyboard instantiateViewControllerWithIdentifier:@"Offers"]; 

[UIView transitionWithView:mainview 
       duration:kAnimationViewTransition 
       options:UIViewAnimationOptionTransitionCurlUp 
      animations:^{ 
       [self.navigationController.view removeFromSuperview]; 
       [mainview addSubview: offers.view]; 
      } 
      completion:^(BOOL finished) { 
       [self presentModalViewController:offers animated:NO]; 
      } 
]; 
+1

雖然這個答案可能確實解決了原來的問題。如果你提供一些解釋和上下文,這將是非常有幫助的。 – Shade

相關問題