UIImage从左到右,从右到左卷曲

时间:2012-09-03 20:17:38

标签: iphone ios uianimation

我有这个代码来卷曲页面,但我需要从左到右或从右到左卷曲页面。请帮忙!

[UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:1.0];
        //[UIView setAnimationBeginsFromCurrentState:NO];
        [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:imagePage cache:YES];

        //UIView *parent = self.view.superview;
        //[self.view removeFromSuperview];

        //[parent addSubview:moreInfo];
        [imagePage setImage:[UIImage imageNamed:[collectionOfImages objectAtIndex:countForPages]]];

        [UIView commitAnimations];

2 个答案:

答案 0 :(得分:0)

您是否尝试将UIViewAnimationTransitionCurlUp替换为其他动画类型之一,例如UIViewAnimationTransitionFlipFromLeft或UIViewAnimationTransitionFlipFromRight?

答案 1 :(得分:0)

只需使用UIViewAnimationTransitionFlipFromLeftUIViewAnimationTransitionFlipFromRight代替UIViewAnimationTransitionCurlUp即可左右翻转。找到示例here以获取指导。对于左右卷曲,请检查可用的示例here