简体   繁体   English

背面的ios three20动画

[英]ios three20 animation on back

i'm using the three20 lib and in depth ttnavigator: my question is this: with this code I change the animation to go in the new navigation: 我正在使用three20 lib并深入使用ttnavigator:我的问题是这样的:使用此代码,我将动画更改为在新导航中使用:

TTURLAction* action;
action = [TTURLAction actionWithURLPath:@"tt://events"]; 
[action setAnimated:YES];
[action setTransition:UIViewAnimationTransitionFlipFromLeft];
[[TTNavigator navigator] openURLAction:action];

and the animation is good, but when in the new view I click the back button, the animation is the standard scroll...it's possible mantain the same? 并且动画效果很好,但是当在新视图中单击后退按钮时,动画是标准滚动...可能保持不变吗?

thanks in advance 提前致谢

If you declare the URL in the TTURLMap, three20 will do that automatically when you dismiss your view controller: 如果您在TTURLMap中声明URL,那么当您关闭视图控制器时,three20将自动执行该操作:

in your app delegate: 在您的应用程序委托中:

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"]];

and in your settings controller, you can use a custom button, so it won't look as a back button: 在您的设置控制器中,您可以使用自定义按钮,因此它不会显示为后退按钮:

///////////////////////////////////////////////////////////////////////////////////////////////////
- (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];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM