2009-10-24 48 views
8

我是新来的iPhone SDK.i现在用以下code.but动画发生 从右向左当我点击这个button.i想要做来回钮以高达使用Pushviewcontroller自下而上的动画?

- (IBAction)clickedsButton:(id)sender 
{ 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:1.0]; 
    [UIView setAnimationDuration:0.75]; 
    [self.navigationController pushViewController:settingsController animated:TRUE]; 
    [UIView commitAnimations]; 
} 

setAnimationTransition只支持两个。 .. 1)UIViewAnimationTransitionFlipFromLeft 2)UIViewAnimationTransitionFlipFromRight .. 请帮忙吗?我用以下,但它不工作

settingsController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 
[self.navigationController pushViewController:settingsController animated:YES]; 

回答

5

你在找什么是

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated; 
+2

我想,通过PUSHVIEWCONTROLLER只能做。因为我已经使用 popviewcontroller在下一个视图控制器(settingsController) 将presentModalViewController支持popviewcontroller .... – 2009-10-24 12:21:03

+3

与presentModalViewController相反:animated:is dismissModalViewController:animated: – Jasarien 2009-10-24 12:43:41

+0

这是Apple的意图,即popViewController是从右向左的动画。它强制用户交互设计,您应该遵循Apple的人机界面指南。从下到上的动画是模态视图。 – Jasarien 2009-10-24 12:45:03

0

SWIFT 3

self.present(newViewController, animated: true, completion: nil) 
相关问题