我正在尝试为启动屏幕制作多个图像。我正在显示 3 个图像作为启动屏幕第一个是启动屏幕的默认图像,而不是使用 Ui-imageview 我在我的 Imageview 上显示第 2 个和第 3 个。
我想在更改启动画面时淡出图像。我尝试了 NSTimmer 解决方案,但它向我显示了直接的第三张图像和缅因屏幕,而不是在我尝试了这个解决方案之后,但它一次又一次地显示了我的第二张和第三张图像 2 次。任何帮助表示赞赏
已编辑/- Nikki 建议我一些解决方案,但我很困惑我在哪个地方取消隐藏我的第二个图像视图?这是我的代码
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
}