diffrence between PushViewController and presentModalViewController in iphone

主宰稳场 提交于 2019-12-22 17:32:39

问题


can anyone explain what the difference is between PushViewController and presentModalViewController?


回答1:


One major difference is that

pushViewController only works in navigation controllers

presentModalViewController works for all view controllers




回答2:


A modal view is made so that it prevents you from doing anything except whatever it is that it wants you to do. You must do something specific to exit the modal state. The modal view also covers up the navigation bar.

When you use PushViewController, it's more flexible through the navigation bar. It doesn't require an extra action to exit to another view.




回答3:


Difference in animation are

pushViewController will slide in your new view from right.

presentModalViewController will pop up your new view.



来源:https://stackoverflow.com/questions/5510072/diffrence-between-pushviewcontroller-and-presentmodalviewcontroller-in-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!