スプラッシュ スクリーン用に複数の画像をアニメーション化しようとしています。スプラッシュ スクリーンとして 3 つの画像を表示しています。
スプラッシュ画面を変更しながら画像をフェードアウトさせたい。NSTimmerソリューションを試しましたが、3番目の画像とメイン画面を直接表示しますこのソリューションを試した後よりも、2番目と3番目の画像が2回ずつ表示されます。どんな助けでも大歓迎です
編集済み/-ニッキは私にいくつかの解決策を提案しますが、2番目の画像ビューを非表示にした場所はどこですか? これが私のコードです
backgroundImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
backgroundImageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
backgroundImageView.image=[UIImage imageNamed:@"SPLASHSCREEN-2.png"];
backgroundImageView2 = [[UIImageView alloc] initWithFrame:self.view.bounds];
backgroundImageView2.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
backgroundImageView2.image=[UIImage imageNamed:@"SPLASHSCREEN-3.png"];
[self.view addSubview:backgroundImageView];
[self.view addSubview:backgroundImageView2];
[backgroundImageView2 setHidden:YES];
[self performSelector:@selector(performTransition) withObject:nil afterDelay:1.0];
-(void)performTransition
{
CATransition *animation3 = [CATransition animation];
[animation3 setDuration:3.0f];
[animation3 setType:kCATransitionReveal];
[animation3 setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[backgroundImageView layer] addAnimation:animation3 forKey:@"SwitchToView"];
[backgroundImageView setHidden:YES];
[backgroundImageView2 setHidden:NO];//No animation happen while changing the image view
}