how to animate launch image once app has finished launching
I was wondering how I can manipulate the launch image of an iPhone app? I have put launchImage.png into my plist file (under Launch ima开发者_开发知识库ge (iPhone)) and when the app starts I would like to animate this launch image out of the view, like so:
launchImage.transform = CGAffineTransformMakeTranslation(-CGRectGetWidth(launchImage.frame), 0);
But how do I access an image which I've defined in my plist?
Or will I simply load another instance of the image and then animate it out of the way? This appears a little cumbersome, especially as the app has already loaded the launch image.
Any suggestions would be very much appreciated! Thanks in advance!
You'll have to load another instance. You can't access the launch image from your app. I usually just make a UIImage that matches the launch image and in my viewDidAppear method I animate it away with a performSelector:withDelay:
of a second or 2.
Your best bet is to create a UIImageView instance set to display your launch image, put it on the root view controller's view, then animate it out of the way as you've described (perhaps in -viewDidAppear:
). As far as I know, there's no API mechanism for interacting with the launch image directly.
You have to load up the launch image again and then animate it out.
精彩评论