2012-05-06 4 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

О, Боже ... Вы, похоже, отформатировали свой код в виде кавычек. – 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

пожалуйста, попробуйте этот way.i используется в навигации зрения одним вида

первого вид для перехода к следующей Infoview я создающий эффект curlup:

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

спасибо разработчикам, оцените вашу помощь. – iscavengers

Смежные вопросы