创建动画启动图像

问题描述 投票:0回答:2

我想知道,当用户打开iPhone应用程序时,如何创建一个动画启动图像,而不是使用一个简单的Default.png,我想在用户打开应用程序时出现一个小的动画。

一个例子,是杰米-奥利弗的应用程序 - 启动屏幕是动画,我想知道如何做到这一点?

iphone cocoa-touch
2个回答
1
投票

一种可能性是将第一个视图设置为一个相同的全屏动画UIView(与启动图像相同),这样就不会感觉到过渡。这个视图可以在几秒左右后删除。


0
投票

iPhone不显示动画图像,但有一个方法,你有运动的飞溅或...正如你所知道的gif文件包含的图像的数量,播放不停止,所以为了做到这一点,在iPhone中,你需要png格式的所有场景,并显示在imageview,UIImageView有animationImages,你应该添加图像名称和动画持续时间的数组和...设置这个。

splashImageView = [[UIImageView alloc] init];
NSMutableArray *splashImageArray = [[NSMutableArray alloc] initWithCapacity:IMAGE_COUNT];

// Build array of images, cycling through image names
for (int i = IMAGE_COUNT; i > 0 ; i-=2)
    [splashImageArray addObject:
     [UIImage imageNamed:
      [NSString stringWithFormat:@"splash_000%d.png", i]
      ]
     ];

splashImageView.animationImages = [NSArray arrayWithArray:splashImageArray];

// One cycle through all the images takes 1.5 seconds

splashImageView.animationDuration = 3.50;
// Repeat forever
splashImageView.animationRepeatCount = 1;
splashImageView.startAnimating;
splashImageView.frame = CGRectMake(0, 20, 320, 460);
[window addSubview:splashImageView];
© www.soinside.com 2019 - 2024. All rights reserved.