私はxcode 4で本当にシンプルなアプリケーションを開発しようとしています。これはユーティリティーアプリケーションで、メインビューが1つあり、 2つ以上の画像間で連続的にループする単純なアルファフェードを用いて背景の写真を表示する。xcodeで2つ以上の背景画像間のフェード(アルファ)をアニメ化する方法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