2011-04-28 48 views

回答

0

對於頁面捲曲,您可以使用視圖過渡動畫。對於滑動手勢,請查看使用新的手勢識別器類。您還可以設置當您展示新的模式視圖控制器以獲得其他過渡樣式時的過渡樣式。

0

我不知道頁面捲曲的方面,我不熟悉葉子,但你可以看看UISwipeGestureRecognizer類文檔,瞭解更多信息。也許你可以擴展葉子源代碼。

1

使用UISwipeGestureRecognizer。沒有什麼可說的,手勢識別器很容易。甚至有關於該主題的WWDC10視頻。會話120和121

蘋果當然使用OpenGL ES來實現它。 Apple實際使用的API是私有的,但這個blogger具有示例代碼實現的開始。所以,現在你只需幾次點擊即可在自定義輕掃手勢內執行頁面捲曲。

3

使用UISwipeGestureRecognizer和UIViewAnimationTransition

- (void)handleSwipe:(UISwipeGestureRecognizer *)sender { 

    if(sender.state == UIGestureRecognizerStateEnded) { 
     [UIView beginAnimations:nil context:NULL]; 
     [UIView setAnimationDuration:0.3]; 
     [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:window cache:YES]; 

     [self.view addSubview:[newView view]]; 
     [oldView removeFromSuperview]; 

     [UIView commitAnimations]; 
    }     
} 
- (void)createGestureRecognizers:(UIView *) target { 
    UISwipeGestureRecognizer *rightSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)]; 

    [rightSwipeRecognizer setDirection:(UISwipeGestureRecognizerDirectionRight)]; 
    [target addGestureRecognizer:rightSwipeRecognizer]; 
    [rightSwipeRecognizer release]; 
}