开发者

iphone - wrong animations

开发者 https://www.devze.com 2023-01-06 09:01 出处:网络
I am building a book where I will use the page curl animation to flip the pages, something like this:

I am building a book where I will use the page curl animation to flip the pages, something like this:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.45f];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:NO];
[UIView commitAnimations];

I will use curl down or up, according to the page being increased or decreased.

At some point the user can click on the chapter button and go a menu where he can choose the chapter. This menu is on a separate view, called using an animation like this

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO];

After the user chooses a chapter, I close the chapters choosing view using

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:NO];

and after this transition finishes, I call a method that will show the first page of the chosen chapter. This page will be shown using a page curl animation.

This is almost working fine, but this is the problem.

If I press the "choose a chapter" button again, instead of seeing a flip from right animation and see the "choose a chapter menu" I will see a page curl, that will review the same page I am already seeing and then, suddenly, the "choose a chapter menu" will appear, with no tr开发者_高级运维ansition.

Is this something related to the animation being cached? Even if I declared the cache property as NO? How do I solve that?

thanks


Set some breakpoints. It sounds more like the "page curl" animation is being called spuriously.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号