Creating Animated Launch Image
I was wondering how one could create an animated launch image when the user opens up an iPhone app as opposed to using a simple Default.png I would like to make a small animation appear when the user opens the app.
An example of this, is the Jamie 开发者_如何学GoOliver app - the launch screen is animated and I have was wondering how this is done?
A possibility is to set the first view as an identical full screen animating UIView (identical to the launch image), so that the transition is not perceived. This view can be removed after a couple of seconds or so.
iPhone don't display animating image but there are one way that you have motion on splash or... As you know the gif file contain the number of images that play without stop, so For doing this in iphone you need png format of all scenes and display them on imageview, UIImageView have animationImages that you should add array of images name and animation duration and ... for set up this.
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];
精彩评论