2012-05-06 2 views
0

컬 효과는 내가 코드 아래 사용하여 컬 효과를 구현하기 위해 노력하고

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.95]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown 
forView:self.view cache:YES]; 
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; 
[UIView setAnimationDelegate:self]; 

을 곱슬 곱슬 니펫을

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.95]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; 
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; 
[UIView setAnimationDelegate:self]; 

를 꼬고하지만이 세로 모드로 작동합니다.

가로 모드로 구현하고 싶습니다. 오른쪽 상단과 왼쪽 하단을 테이핑합니다.

현재 역 효과가 있습니다.

많은 감사

+0

Oh dear ... 코드를 따옴표로 묶었습니다. – CodaFi

+2

"오른쪽 상단 및 왼쪽 하단 테이프"란 무엇입니까? 그리고 당신이 역으로 작동한다고 말할 때 : 무엇을 반대합니까? – EmilioPelaez

+0

현재, 컬은 오른쪽 상단에서 내려오고 대신 오른쪽 하단에서 필요합니다. – iscavengers

답변

2
#import <QuartzCore/QuartzCore.h> 

-(void)pageCurltoNextorPrevious:(UIView*)view:(int)identifier { 

// Curl the image up or down 
CATransition *animation = [CATransition animation]; 
[animation setDelegate:self]; 
[animation setDuration:1.0]; 
CAMediaTimingFunction *fun=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 
[animation setTimingFunction:fun]; 


if (identifier==1){ 
    //next animation 
    animation.type = @"pageCurl"; 
    [email protected]"fromRight"; 
    animation.fillMode = kCAFillModeForwards; 
    animation.endProgress = 1.0; //0.58; 
} 
else { 
    //previous animation 
    animation.type = @"pageCurl"; 
    [email protected]"fromLeft"; 
    animation.fillMode = kCAFillModeBackwards; 
    animation.startProgress = 0.0; 
} 
[animation setRemovedOnCompletion:NO]; 

//[view exchangeSubviewAtIndex:0 withSubviewAtIndex:2]; 

[[view layer] addAnimation:animation forKey:@"pageCurlAnimation"]; 
} 
+0

감사합니다. 실행 해 주셔서 감사합니다. – iscavengers

1

, 내가 curlup 효과 creat에 다음 InfoView에 가야 하나 개보기

1 뷰에서 뷰 탐색에 사용이 길이야을 시도하십시오 :

InfoView *objdb=[[InfoView alloc] initWithNibName:@"InfoView" bundle:nil]; 
[UIView beginAnimations:nil context:NULL ]; 
[UIView setAnimationCurve:UIViewAnimationTransitionCurlUp]; 
[UIView setAnimationDuration:1.0]; 
[self presentModalViewController:objdb animated:YES]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO]; 
[UIView commitAnimations]; 
[objdb release]; 

을 그런 다음 infoview에서 기본보기로 돌아가서 다음을 사용하십시오 (컬 효과 제거) :

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationCurve:UIViewAnimationTransitionCurlDown]; 
[UIView setAnimationDuration:0.75]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO]; 
[UIView commitAnimations]; 
[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDelay:0.375]; 
[self dismissModalViewControllerAnimated:YES]; 
[UIView commitAnimations]; 

나는 그것이 도움이되기를 바랍니다.

+0

감사합니다. dev, 도와 주셔서 감사합니다. – iscavengers