如何设置iPhone新屏幕向左的动画

如何设置iPhone新屏幕向左的动画,iphone,animation,Iphone,Animation,我是iPhone的新手,刚刚开始开发 因为有你这样的朋友,我学到了很多 我刚刚学会了如何从当前屏幕转到另一个屏幕,由于来自互联网的教程,我做得很好 但现在的问题是,当新屏幕出现时,它会从下到上设置动画,当我们单击“完成”按钮关闭屏幕时,它会从上到下设置动画。我在iPhone上看到过许多应用程序,它们从右到左,再从左到右为新屏幕设置动画 我需要在下面添加哪段代码才能使其向左移动。 朋友们,请引导我 MainScreen *screen = [[MainScreen alloc] initWithN

我是iPhone的新手,刚刚开始开发

因为有你这样的朋友,我学到了很多

我刚刚学会了如何从当前屏幕转到另一个屏幕,由于来自互联网的教程,我做得很好

但现在的问题是,当新屏幕出现时,它会从下到上设置动画,当我们单击“完成”按钮关闭屏幕时,它会从上到下设置动画。我在iPhone上看到过许多应用程序,它们从右到左,再从左到右为新屏幕设置动画

我需要在下面添加哪段代码才能使其向左移动。 朋友们,请引导我

MainScreen *screen = [[MainScreen alloc] initWithNibName:@"MainScreen" bundle:[NSBundle mainBundle]];

 self.mainScreen = screen;

 [self presentModalViewController:mainScreen animated:YES];
而不是这个

[self.navigationController presentModalViewController:yourView animated:YES];
用这个

 [self.navigationController pushViewController:yourView animated:YES];
而不是这个

[self.navigationController presentModalViewController:yourView animated:YES];
用这个

 [self.navigationController pushViewController:yourView animated:YES];

如果您有基于导航的应用程序,请将代码替换为以下内容

MainScreen *screen = [[MainScreen alloc] initWithNibName:@"MainScreen" bundle:[NSBundle mainBundle]];
self.mainScreen = screen;
[self.navigationController pushViewController:screen animated:YES];

如果您有基于导航的应用程序,请将代码替换为以下内容

MainScreen *screen = [[MainScreen alloc] initWithNibName:@"MainScreen" bundle:[NSBundle mainBundle]];
self.mainScreen = screen;
[self.navigationController pushViewController:screen animated:YES];

可用的模态视图过渡样式很少。这方面的文件


此外,中也介绍了一些UIViewTransition动画样式。

可用的模态视图过渡样式很少。这方面的文件


此外,中也介绍了一些uiviewtransitionanimation样式。

视图控制器有四种不同的模型转换

你可以把它们设定为

screen.modalTransitionStyle = UIModalTransitionStylePartialCurl;
您还可以查看其他3种样式


如果你需要做一些类似导航风格的事情。您需要将视图控制器推送到导航堆栈

[self.navigationController pushViewController:screen animated:YES];

视图控制器有四种不同的模型转换

你可以把它们设定为

screen.modalTransitionStyle = UIModalTransitionStylePartialCurl;
您还可以查看其他3种样式


如果你需要做一些类似导航风格的事情。您需要将视图控制器推送到导航堆栈

[self.navigationController pushViewController:screen animated:YES];

你有基于导航控制器的应用程序吗?你有基于导航控制器的应用程序吗?因为第一个代码段在我这边不起作用。现在,我从您那里了解到,我需要为此使用navigationController堆栈。谢谢你的帮助。因为第一个代码片段对我来说不起作用。现在,我从您那里了解到,我需要为此使用navigationController堆栈。谢谢你的帮助。