1
我試圖開發在Xcode 4一個非常簡單的應用程序這是一個實用的應用程序,其中一個主視圖2個或更多的背景圖像之間的動畫漸變(阿爾法),我想動畫系列在背景中用一個簡單的阿爾法淡入淡出照片,在兩個或更多圖像之間連續循環。如何在Xcode 4
我發現Xcode的用戶文檔,我已經修改了(下圖)在一些代碼,但我在此很新的,我問怎麼設置下面的代碼運動在現有的項目,在哪裏放什麼,網點建立,等:
// This method begins the first animation.
- (IBAction)showHideView:(id)sender
{
[UIView beginAnimations:@"ShowHideView" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(showHideDidStop:finished:context:)];
// Make the animatable changes.
secondImageView.alpha = 0.0;
// Commit the changes and perform the animation.
[UIView commitAnimations];
}
// Called at the end of the preceding animation.
- (void)showHideDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
{
[UIView beginAnimations:@"ShowHideView2" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelay:1.0];
secondImageView.alpha = 1.0;
[UIView commitAnimations];
}
感謝李。這有所幫助。 – jhilgert00 2012-01-25 20:49:13