2011-10-05 50 views

回答

1

如果您希望您的應用程序是iOS的< 4兼容,使用此:

[UIView beginAnimations:@"animation" context:nil]; 
[UIView setAnimationCurve:UIViewAnimationCurveLinear]; //Different Animation Curves available, check docs. 
[UIView setAnimationDuration:1.0]; //In seconds 
//Here do your stuff 
int newPosY = myImage.frame.origin.y - 10; 
[myImage setFrame:CGRectMake(self.frame.origin.x, newPosY, myImage.frame.size.width,  myImage.frame.size.height)]; 

[UIView commitAnimations]; 

這個片段移動圖像10像素的。您可以在致電commitAnimations

之前自定義動畫對圖像幀進行更改,然後再檢查UIView Reference以獲取擴展信息。

+0

感謝您的回答。我腦中有這個想法,但不知道如何實施。讓我嘗試。謝謝 –

+0

我試過了。在這種情況下,時鐘將向上移動。時鐘的下半部分應該固定在某些點上。再次需要幫助。 –