2014-04-11 83 views
0

我在我的應用程序中定製了UITableViewCell。當我點擊這個單元格時,我希望這個單元格從左到右執行一些彈簧效果動畫。我該如何做這樣的動畫?UITableViewCell上的iOS春天動畫

回答

1

隨着animateWithDuration: animation:你可以做一些整潔的東西。

它這樣使用:

[UIView animateWithDuration:(float duration) animation^{(block)}]; 

Duration是它會執行animation的時間,block是什麼是假設在duration內發生,例如:

cell.center = CGPointMake(cell.center.x+50, cell.center); 
1

在iOS 7.0及更高版本中,您可以使用+animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion: