views:

3166

answers:

2

I'm pretty sure I can create a page flip effect using a series of PNGs to simulate the animation but is there a way to do it programmatically? Tried googling it and looking at Apple sample code but didn't see anything addressing that particular animation.

+5  A: 

I'm assuming you mean for an iPhone, right?

From the Apple API docs for UIView:

+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache

where UIViewAnimationTransition is defined as:

typedef enum {
   UIViewAnimationTransitionNone,
   UIViewAnimationTransitionFlipFromLeft,
   UIViewAnimationTransitionFlipFromRight
   UIViewAnimationTransitionCurlUp,
   UIViewAnimationTransitionCurlDown,
} UIViewAnimationTransition;

UIViewAnimationTransitionCurlUp is what you are looking for. See those docs for information on how to start, set, and commit animations to views as well.

Marc W
yes, just found that. thanks!
sam
UIViewAnimationTransitionCurlUp and UIViewAnimationTransitionCurlDown are iOS 4.0 only. Also, they don't offer a left / right curl.
brianegge
I answered this question long before iOS 4 was even being developed...
Marc W
A: 

Hay in UIViewAnimationTransitionCurlUp animation after curl up image position is still there only how to avoid that

jeeva