Hi, i have different images in a uiscrollview and i want to know if it´s possible to create an mask-overlay from from 100% - 50% - 0% transparency, so i get smooth fades when the images are moving out.
A:
Depending on what you are trying to do you can simply create an overlay view that is black and change it's alpha to 0 and animate the change. Something like this should do the trick:
[UIView beginAnimations:@"fadeView" context:nil];
[UIView setAnimationDuration:0.65];
overlayView.alpha = 0.0;
[UIView commitAnimations];
Or you could use CATransition, where something like this should do it:
// First create a CATransition object to describe the transition
CATransition *transition = [CATransition animation];
transition.duration = 0.5;
// using the ease in/out timing function
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[[self.view layer] addAnimation:transition forKey:@"slideShowOptionsFadeIn"];
joelm
2010-08-03 13:44:11