2011-03-07 47 views
0

如何從UIView轉換到其他,如從左邊或右邊的幻燈片?iPhone xCode |滑動UIView

+0

樣品被稱爲ViewTransitions http://developer.apple.com/library/ios/#samplecode/ViewTransitions/Introduction/Intro.html – NWCoder

回答

0

寫這樣的東西。

[UIView beginAnimations:@"" context:NULL]; 

//The new position for view1 
[myview1 setFrame: CGRectMake(0,0,320,100)]; 

//The new position for view2 
[myview2 setFrame: CGRectMake(320, 0, 320, 100)]; 

//The animation duration 
[UIView setAnimationDuration:2.0]; 

[UIView setAnimationDelay: UIViewAnimationCurveEaseIn]; 

[UIView commitAnimations]; 
+0

感謝texmex5你應該是公認的答案。在「uiview commanimations」的谷歌搜索引導我http://www.raywenderlich.com/2454/how-to-use-uiview-animation-tutorial其中有一個示例項目 –