2012-09-03 192 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

我想捲曲效果不翻轉 –

相關問題