简体   繁体   English

Xcode:如何从左到右更改情节提要板加载动画

[英]Xcode : how to change storyboard load animation left to right

How i can change storyboard animation from left to right without segue ? 我如何在不进行segue的情况下从左到右更改情节提要动画?

here is the code with which I load the storyboard : 这是我加载情节提要的代码:

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"LoadApplicationStoryboard" bundle:nil];
UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"ApplicationController"];
[self presentViewController:vc animated:YES completion:nil];

Instead of present just push you viewcontroller 代替当前,只是推动您的viewcontroller

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"LoadApplicationStoryboard" bundle:nil];
UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"ApplicationController"];
[[self navigationController] pushViewController:vc animated:YES];

试试这个.. 在这里 ,在寿后,你可以做自定义动画Segue前左到右使用CATransition

If you are developing iOS 7+ application than custom Transitions are what you need. 如果您要开发iOS 7+应用程序,则需要自定义转换。 You can give any kind of animation you want to give while going from one view controller to other. 从一个视图控制器转到另一个视图控制器时,您可以提供任何想要的动画。

Yes it is not one line code and require some time to learn but it is worth. 是的,它不是一个行代码,需要一些时间来学习,但这是值得的。 You just need to implement two delegate method (ope for Present and one for dismiss) and animation code and you are done. 您只需要实现两个委托方法(Ope代表Present,一个代表Dismiss)和动画代码即可完成。

You can learn that from here : 您可以从这里了解到:

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

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