2 Problems with setAnimationTransition
2 Problems with setAnimationTransition
- Subject: 2 Problems with setAnimationTransition
- From: David <email@hidden>
- Date: Fri, 20 Nov 2009 16:26:26 -0700
I'm having two problems with UIView setAnimationTransition. I have a
single image that I am flipping (a UIImageVIew). The effect I am
aiming for is flipping the image over such that when it is flipped
over there is a resulting blank (black) space where the image should
be. Also, in order for there to be something visible in the second
half of the animation (when the black back in rotating into place)
I've added an alpha fade so you can still see the (fading) image until
the animation is complete. Here is the code:
- (void)flipView: (UIView *)aView {
aView.transform = (aView.alpha == 1.0)
? CGAffineTransformMake(-1.0, 0.0, 0.0, 1.0, 0.0, 0.0) :
CGAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
[UIView beginAnimations: @"Flip" context: nil];
[UIView setAnimationDuration: 2.5];
[UIView setAnimationTransition:
UIViewAnimationTransitionFlipFromRight forView: aView cache: FALSE];
aView.alpha = (aView.alpha == 0.0 ? 1.0 : 0.0);
[UIView commitAnimations];
}
- (void)viewDidAppear: (BOOL)animated {
[self flipView: myUIImageView];
[super viewDidAppear: animated];
}
-(IBAction) viewTouched: (id)sender {
[self flipView: myUIImageView];
}
The image starts off not visible. (I.e. alpha = 0.0). The first
problem I am having is that the first time viewDidAppear gets called
(when my application launches) there is no flip animation. The alpha
fades in (to 1.0) but there is no flip.
The second problem I am having is that when I flip from not visible to
visible, there is no alpha fade in on the first half of the
transition. Which means that nothing visible is occurring. Going
from visible to not visible is fine. There is a very nice alpha fade
during the second half of the animation.
Your thoughts?
Thanks,
David
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden