我正在展示一个简单的模态 ViewController 调用
[self performSegueWithIdentifier:@"SegueLogOut" sender:nil];
然而,当我关闭它时,我希望它向上移动而不是向下移动,这可能吗?
[self dismissViewControllerAnimated:YES completion:nil];
编辑:
我尝试制作自定义动画,但效果不佳。背景保持黑色,直到模态消失...
[UIView animateWithDuration:1 animations:^{
self.view.frame = CGRectMake(0, -self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height);
} completion:^(BOOL finished) {
[self dismissViewControllerAnimated:NO completion:nil];
} ];
最佳答案
通常,要更改 presentViewController
动画样式,您可以在 viewController
上设置一个 modalTransitionStyle
属性。
但是,为了回答您的问题,没有一个(少数)modalTransitionStyle
具有向上动画的预定义样式。
你需要自己做动画。
关于ios - 向上而不是向下关闭 ViewControll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20446309/