我见过很多应用,例如天空新闻, Glympse 等,在他们的应用上有启动画面等动画
我不确定这是作为视图控制器或 appdelegate 中的动画完成的,还是实际电影文件
是否有人知道如何实现这种效果?
感谢。
答案 0 :(得分:0)
是动画启动画面是一个视图控制器。这个tutorial可以帮助您创建一个。
答案 1 :(得分:0)
如果要创建动画加载屏幕,可以这样做:
·H
@interface ViewController : UIViewController {
IBOutlet UIImageView *AnitmationimageView;
IBOutlet UIImageView *Loadimageview;
}
-(void)delay1;
-(void)delay2;
-(void)delay3;
的.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
AnitmationimageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"L1.png"],
[UIImage imageNamed:@"L2.png"],
[UIImage imageNamed:@"L3.png"],
[UIImage imageNamed:@"L4.png"], nil];
[AnitmationimageView setAnimationRepeatCount:1];
AnitmationimageView.animationDuration = 3;
[AnitmationimageView startAnimating];
[self performSelector:@selector(delay1) withObject:nil afterDelay:3];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)delay1 {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[AnitmationimageView setAlpha:0];
[UIView commitAnimations];
[self performSelector:@selector(delay2) withObject:nil afterDelay:1.0];
}
-(void)delay2 {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[Loadimageview setAlpha:1];
[UIView commitAnimations];
[self performSelector:@selector(delay3) withObject:nil afterDelay:1.5];
}
-(void)delay3 {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[Loadimageview setAlpha:0];
[UIView commitAnimations];
}
所有这些代码均来自http://GeekyLemon.com
答案 2 :(得分:0)
只需简单地通过添加屏幕全图像来实现这一点。将图像数组分配给imageView的animationImages属性,如此
for(int i = 1; i < numOfImages; i++) {
[totalAnimationImages addObject:[UIImage imageNamed:
[NSString stringWithFormat:@"%@%d.png", image, i]]];
}
imageView.animationImages = totalAnimationImages;
imageView.animationDuration = 1; //speed
imageView.animationRepeatCount = 1; //infinite loop
[imageView startAnimating];