J'essaie d'appeler [[self navigationController] popViewControllerAnimated:YES]
mais en faisant glisser l'animation de droite à gauche plutôt que de gauche à droite. Un moyen facile de le faire? Je veux revenir à la vue précédente. Toute aide est appréciée. Merci!UINavigationController: contrôleur de vue pop dans la direction opposée
Répondre
Il est possible, regardez le code suivant que j'ai utilisé il y a quelque temps et essayez de le faire fonctionner pour vous-même. Yu seulement besoin de changer le setAnimationTransition
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelay:0.375];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];
Il y a quelques différents types d'animations par défaut à utiliser, le site pommes dit ce genre d'animations sont possibles:
typedef enum {
UIViewAnimationTransitionNone,
UIViewAnimationTransitionFlipFromLeft,
UIViewAnimationTransitionFlipFromRight,
UIViewAnimationTransitionCurlUp,
UIViewAnimationTransitionCurlDown,
} UIViewAnimationTransition;
Donc, dans votre cas, vous voulez pour utiliser ce qui suit:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController popViewControllerAnimated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
C'est ainsi que l'on peut voir le contrôleur dans le sens opposé. Son travail pour moi 100%
CATransition *transition = [CATransition animation];
transition.duration = 0.45;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
transition.type = kCATransitionFromRight;
[transition setType:kCATransitionPush];
transition.subtype = kCATransitionFromRight;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController popViewControllerAnimated:NO];
c'est ce que je cherchais !! Merci. – iChirag
Vous définissez le type deux fois? 'transition.type = kCATransitionPush' devrait suffire. –
- 1. Redimensionner UIView dans la direction opposée
- 2. iOS - pop vue dans le parent UINavigationController
- 3. Recherche de la direction opposée dans un système de coordonnées
- 4. iOS open source contrôleur intelligent push/pop lib pour uinavigationcontroller?
- 5. UINavigationController - Pop
- 6. pop une vue spécifique contrôleur
- 7. UINavigationController Pop One Voir
- 8. UINavigationController - bug de l'animation pop
- 9. pushviewcontroller ou pop to viewcontroller UINavigationController
- 10. Flux spécifique dans la vue pop du contrôleur de navigation
- 11. Positionnement de la latitude et de la longitude dans la direction opposée
- 12. UINavigationController sur la vue Flipside
- 13. UINavigationController Interactive Pop Gesture ne fonctionne pas?
- 14. pop au premier contrôleur de vue (contrôleur de vue racine) du contrôleur troisième vue navigationItems ne sont pas modifiés
- 15. UICollectionView et appelle UITableView scrollViewDidScroll après une pop sur UINavigationController
- 16. Transmission des données au contrôleur de vue pointé par UINavigationController
- 17. UINavigationController affichant la mauvaise vue
- 18. UINavigationController ne pas pousser le contrôleur de vue
- 19. Comment naviguer de Pop vers un autre contrôleur de vue
- 20. basculer vue avec UINavigationController
- 21. Comment obtenir la vue enfant UINavigationController
- 22. iPhone UINavigationController: anime seulement une partie de la vue
- 23. iOS8 UINavigationController push/pop avec transparent UIView issue
- 24. L'animation d'arrière-plan jQuery se déplace dans la direction opposée lors du premier vol stationnaire
- 25. Bouton de retour personnalisé pour UINavigationController sans barre de navigation et d'animation dans la bonne direction
- 26. Chaîne UIViewControllers pousser et pop animation avec UINavigationController rejeter/présent vue modale?
- 27. UINavigationController ne pousse pas la vue
- 28. Pousser une autre vue dans UINavigationController?
- 29. contrôleur UINavigation Push and Pop
- 30. UINavigationController - Exécuter le code avant d'afficher le contrôleur
Merci. Est-il possible de le faire glisser comme si vous appeliez 'pushViewController'? – Mason
Oui, comme je l'ai dit, il suffit de changer la ligne ici: [UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft pourView: self.navigationController.view cache: NO]; – Wesley
Je comprends cela. Je ne peux pas trouver la transition correcte cependant. – Mason