2012-09-03 146 views
1

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

[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]; 

回答

0

只需使用UIViewAnimationTransitionFlipFromLeftUIViewAnimationTransitionFlipFromRight而不是UIViewAnimationTransitionCurlUp即可左右翻转。请参阅样本here以获取指导。对于左右卷曲,请检查可用样本here

+2

但我想卷曲效果不翻转 –

+0

检查http://stackoverflow.com/questions/1625375/iphone-curl-left-and-curl-right-transitions – iOS

+0

检查http:// stackoverflow.com/questions/2929498/iphone-how-to-show-curl-animation-from-left-side – iOS

0

您是否尝试过其他动画类型中的一种替代UIViewAnimationTransitionCurlUp,例如说UIViewAnimationTransitionFlipFromLeft或UIViewAnimationTransitionFlipFromRight?

+0

我想卷曲效果不翻转 –

相关问题