ios Three20 animation sur le dos
-
28-10-2019 - |
Question
J'utilise le Three20 lib et en profondeur ttnavigator: ma question est la suivante: avec ce code je change l'animation pour aller dans la nouvelle navigation:
TTURLAction* action;
action = [TTURLAction actionWithURLPath:@"tt://events"];
[action setAnimated:YES];
[action setTransition:UIViewAnimationTransitionFlipFromLeft];
[[TTNavigator navigator] openURLAction:action];
et l'animation est bonne, mais quand dans la nouvelle vue je clique sur le bouton de retour, l'animation est le défilement ... la norme, il est possible mantenir la même chose?
Merci à l'avance
La solution
Si vous déclarez l'URL dans le TTURLMap, Three20 le fera automatiquement lorsque vous remercierez votre contrôleur de vue:
dans votre délégué application:
TTNavigator* navigator = [TTNavigator navigator];
navigator.persistenceMode = TTNavigatorPersistenceModeNone;
TTURLMap* map = navigator.URLMap;
[map from:@"tt://settings" toViewController:[SettingsController class] transition:UIViewAnimationTransitionFlipFromLeft];
[navigator openURLAction:[TTURLAction actionWithURLPath:@"tt://settings"]];
et dans votre contrôleur de paramètres, vous pouvez utiliser un bouton personnalisé, donc il ne sera pas un bouton de retour:
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)viewDidLoad {
[super viewDidLoad];
TTButton* settingsButton = [TTButton
buttonWithStyle:@"grayToolbarButton:"
title:NSLocalizedString(@"DONE", @"")];
[settingsButton sizeToFit];
[settingsButton addTarget:self action:@selector(dismissSettings)
forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.hidesBackButton = YES;
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithCustomView:settingsButton] autorelease];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)dismissSettings {
[self.navigationController popViewControllerAnimated:YES];
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow