3 ms·
Animate from Default.png to the first view: CABasicAnimation *a = [CABasicAnimation animationWithKeyPath:@"opacity"]; a.duration = 3.0; a.fromValue = [NS
by pkaler 16y ago
Animate from Default.png to the first view:
CABasicAnimation *a = [CABasicAnimation animationWithKeyPath:@"opacity"];
a.duration = 3.0;
a.fromValue = [NSNumber numberWithFloat:1.0];
a.toValue = [NSNumber numberWithFloat:0.0];
[theLayer addAnimation:a forKey:@"animateOpacity"];
Warning: tapped out that code off the top of my head and didn't put it through a compiler.
- rbritton 16y agoI've tried to do this with my own app before. I ran into difficulties doing it, if I remember right, because the orientation data is not fully initialized at the point in the launch sequence that you need it. It always reports the default orientation.
- Xuzz 16y agoMay I ask why you aren't using the UIView animations, which, for something like this, are easier (and don't need the extra CA power)? For this case, do this (also uncompiled): [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:3.0]; [defaultImageView setAlpha:0.0]; [UIView commitAnimations];
- pkaler 16y agoFrom the documentation: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html http://developer.apple.com/library/ios/#documentation/uikit/... Use of this method is discouraged in iOS 4.0 and later. You should use the block-based animation methods instead. Frankly, it's because I can't remember the block based methods off the top of my head yet.
- Xuzz 16y agoInteresting; I didn't know that. The block-based methods are, of course, better, but then you can't support iOS 3.x, which is still a pretty big percent of users. Thanks!