Hi all,
I plan to do multiple images fade in/out using UIImageView just like Flicker iphone app.
Here are the steps:
1. Load pic1.
2. pic1 move from left to right.
3. pic1 will slowly turn to become transparent while still moving.
4. Same time pic2 is moving from right to left.
I am managed to have the pic1 slowly fading out after it stop moving and pic2 move in at the same time. However what i want is to have the pic1 slowly fading out while it is still moving.
Can anybody help me to look at my code below: Thanks.
- (void)viewDidLoad {
[super viewDidLoad];
CGPoint newLeftCenter = CGPointMake(180, 240);
[UIView beginAnimations
"move1" context:NULL];
[UIView setAnimationDuration:6.0f];
[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromRight];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector
selector(movingStop:finished:context
];
pic1.center = newLeftCenter;
[UIView commitAnimations];
}
- (void)movingStop
NSString*)animationID finished
BOOL)finished context
void *)context {
if ( [animationID isEqualToString
"move1"] ) {
CGPoint newLeftCenter = CGPointMake(200, 260);
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromLeft];
[UIView setAnimationDuration:3.0];
pic2.alpha = 1.0;
pic2.center = newLeftCenter;
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:selector(movingStop:finished:context
];
[UIView commitAnimations];
}
I plan to do multiple images fade in/out using UIImageView just like Flicker iphone app.
Here are the steps:
1. Load pic1.
2. pic1 move from left to right.
3. pic1 will slowly turn to become transparent while still moving.
4. Same time pic2 is moving from right to left.
I am managed to have the pic1 slowly fading out after it stop moving and pic2 move in at the same time. However what i want is to have the pic1 slowly fading out while it is still moving.
Can anybody help me to look at my code below: Thanks.
- (void)viewDidLoad {
[super viewDidLoad];
CGPoint newLeftCenter = CGPointMake(180, 240);
[UIView beginAnimations
[UIView setAnimationDuration:6.0f];
[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromRight];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector
pic1.center = newLeftCenter;
[UIView commitAnimations];
}
- (void)movingStop
if ( [animationID isEqualToString
CGPoint newLeftCenter = CGPointMake(200, 260);
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromLeft];
[UIView setAnimationDuration:3.0];
pic2.alpha = 1.0;
pic2.center = newLeftCenter;
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:selector(movingStop:finished:context
[UIView commitAnimations];
}