2013-03-25 13 views
1

創建自定義UIView動畫過渡的最簡單方法是什麼? Google搜索中彈出的大多數教程都不是最新的。 (我使用的XCode 4.5版本)在我目前的iPhone應用程序,我有以下代碼爲我的屏幕轉換:如何創建自定義UIViewAnimation

[UIView beginAnimations:@"View flip" context:nil]; 
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 
[UIView setAnimationDuration:1.25]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view       cache:YES];  
[UIView commitAnimations]; 

我想唯一的,而不是5或6內置的轉換的東西。任何想法或建議從哪裏開始?

+1

首先,不要使用舊方法,就像您在問題中顯示的那樣。使用基於塊的方法。 – rdelmar 2013-03-26 00:05:48

回答

1

我認爲這是你在找什麼:

[UIView animateWithDuration:0.3 animations:^{ 
    //Move frame or transform view 
}]; 

內部的塊,你可以把任意的動畫代碼。

+0

非常好!我會去這裏玩! – 2013-03-26 00:27:04