iOS - pushViewController 与 presentModalViewController 的区别

iOS - pushViewController vs presentModalViewController difference(iOS - pushViewController 与 presentModalViewController 的区别)
本文介绍了iOS - pushViewController 与 presentModalViewController 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调用 presentModalViewControllerpushViewController 有什么区别,当:

What is the difference beetween calling presentModalViewController and pushViewController, when :

  • animation 设置为 NO(即使是,也只是可以更改的动画样式).
  • 在呈现模态视图时定义了一个导航控制器,因此它也可以通过调用堆栈进行导航......

这只是为了能够从第一个推送视图返回吗?呜呜呜……

Is this just to be able to go back from the first pushed view ? Woooaaaaaa.....

我想区别在别处和更深的地方.没有?

I guess the difference is elsewhere and deeper. No ?

推荐答案

最重要的区别在于语义.模态视图控制器通常指示用户必须提供一些信息或做某事.此链接更深入地解释它:http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html

The most important difference is about semantics. Modal view controllers typically indicate that the user has to provide some information or do something. This link explains it more in depth: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html

这是他们谈论的另一个不太抽象的区别:

Here's another, less abstract difference they talk about:

"当你呈现一个模态视图控制器时,系统会在执行呈现的视图控制器和被呈现的视图控制器之间创建父子关系.具体来说,执行呈现的视图控制器将其 modalViewController 属性更新为指向其呈现的(子)视图控制器.类似地,呈现的视图控制器更新其 parentViewController 属性以指向呈现它的视图控制器."

"When you present a modal view controller, the system creates a parent-child relationship between the view controller that did the presenting and the view controller that was presented. Specifically, the view controller that did the presenting updates its modalViewController property to point to its presented (child) view controller. Similarly, the presented view controller updates its parentViewController property to point back to the view controller that presented it."

另请参阅此主题:为什么要呈现模态视图控制器"?

这篇关于iOS - pushViewController 与 presentModalViewController 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)