2010-03-27 5 views
7

J'utilise ce code pour l'effet Page curl .... Son travail bien dans le simulateur et l'appareil ... Mais ce n'est pas (setType: @ "pageCurl") Apple documenté api, cela l'a causé d'être rejeté par le Programme pour développeurs iPhone au cours du processus d'examen App Store:Iphone page curl effet

animation = [CATransition animation]; 
[animation setDelegate:self]; 
[animation setDuration:1.0f]; 
animation.startProgress = 0.5; 
animation.endProgress = 1; 
[animation setTimingFunction:UIViewAnimationCurveEaseInOut]; 
[animation setType:@"pageCurl"]; 
[animation setSubtype:@"fromRight"]; 
[animation setRemovedOnCompletion:NO]; 
[animation setFillMode: @"extended"]; 
[animation setRemovedOnCompletion: NO]; 
[[imageView layer] addAnimation:animation 
         forKey:@"pageFlipAnimation"]; 

donc j'ai changé et en utilisant comme celui-ci

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:1]; 
[UIView setAnimationDelegate:self]; 
[UIView setAnimationBeginsFromCurrentState:YES]; 
[UIView setAnimationCurve:UIViewAnimationCurveLinear]; 
[UIView setAnimationWillStartSelector:@selector(transitionWillStart:finished:context:)]; 
[UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)]; 
// other animation properties 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp 
         forView:imageView cache:YES]; 
// set view properties 
[UIView commitAnimations]; 

Dans ce code ci-dessus que je veux arrêter la page effet boucle à mi-chemin .. Mais je ne peux pas l'arrêter à mi-chemin comme des applications de carte dans l'iPod ... Est-ce une solution pour cela? ou Y a-t-il des méthodes documentées de pomme utilisées pour l'effet de boucle de page dans l'iPod touch?

Je recherche beaucoup. mais n'a pas eu de réponse? Quelqu'un peut-il m'aider? Merci d'avance..plz

+0

Bonjour à tous. Donc vous avez utilisé le type @pagecurl et l'application a été rejetée? – user281300

+0

Si vous souhaitez faire une boucle partielle, mais garder une barre d'outils stationnaire, comme dans l'application Maps d'Apple, consultez ma solution [ici] (http://stackoverflow.com/a/11406056/1148702). –

Répondre

1

Faut-il utiliser l'effet de bouclage de page à l'arrêt? La méthode la plus simple consiste à remplacer la boucle de page par une animation plus simple (par exemple, glisser vers l'extérieur), ou à simplement boucler toute la vue.

Vous pouvez essayer de tricher en construisant la chaîne au moment de l'exécution, par ex.

[animation setType:[@"page" stringByAppendingString:@"Curl"]]; 

bien que vous utilisiez toujours une méthode non documentée.

+0

Je me demande si cela pourrait passer entre les mailles du filet ... Quelqu'un a-t-il de l'expérience dans ce domaine? – coneybeare

9

Si je peux?

SampleViewController *sampleView = [[[SampleViewController alloc] init] autorelease]; 
[sampleView setModalTransitionStyle:UIModalTransitionStylePartialCurl]; 
[self presentModalViewController:sampleView animated:YES]; 

......

0

curling partielle est officiellement pris en charge depuis SDK 3.2. Vérifiez l'exemple de code de Chris. Plus d'informations peuvent être trouvées dans la référence de classe UIViewController sous Constantes.

+0

Cela ne semble pas fonctionner de la même manière que Maps. C'est-à-dire que vous pouvez appliquer cette transition à l'ensemble de la vue, mais pas à une sous-vue et donc quitter la barre d'outils. –

4

J'ai trouvé une solution pour ajouter un UIView à UIViewController en utilisant le bloc Animation. M_Container est un UIView qui contient mon animation de vue (self). self est un UIView.

ATTENTION: Vous devez avoir l'importation QuartzCore

Présenter vue avec la page animation boucle vous pouvez utiliser:

-(void)PresentView 
{ 
    [UIView animateWithDuration:1.0 
        animations:^{ 
         CATransition *animation = [CATransition animation]; 
         [animation setDelegate:self]; 
         [animation setDuration:0.7]; 
         [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; 
         animation.type = @"pageCurl"; 
         animation.fillMode = kCAFillModeForwards; 
         animation.endProgress = 0.65; 
         [animation setRemovedOnCompletion:NO]; 
         [m_container.layer addAnimation:animation forKey:@"pageCurlAnimation"]; 
         [m_container addSubview:self]; 
         ;} 
    ];  
} 

Et quand vous voulez cacher ce point de vue, vous pouvez utiliser:

-(void)HideHelpView 
{ 
    [UIView animateWithDuration:1.0 
        animations:^{ 
         CATransition *animation = [CATransition animation]; 
         [animation setDelegate:self]; 
         [animation setDuration:0.7]; 
         [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; 
         animation.type = @"pageUnCurl"; 
         animation.fillMode = kCAFillModeForwards; 
         animation.startProgress = 0.35; 
         [animation setRemovedOnCompletion:NO]; 
         [m_container.layer addAnimation:animation forKey:@"pageUnCurlAnimation"]; 
         [self removeFromSuperview]; 

         ;} 
    ]; 

} 

J'espère que je vous ai aidé.

+0

Ce code est incorrect. Les arguments de CATransition setTimingFunction: sont de type UIViewAnimationCurve, pas CAMediaTimingFunction. Utilisez CAMediaTimingFunction functionWithName: pour obtenir une fonction de minutage. – titaniumdecoy

+0

votre code a résolu mon problème de curl et uncurl merci ...... – Leena

+0

pas de problème je suis heureux de vous aider :) – TheRonin