简体   繁体   English

方法“插入子视图”和“ presentModalViewController”之间有什么区别?

[英]What is the difference between methods “insert subview” and “presentModalViewController”?

更改笔尖视图时,这两种方法有什么区别?

addSubview:方法只是向视图层次结构中添加一个新视图,而presentModalViewController:animated:使给定的视图控制器成为活动视图控制器(并使其视图可见)。

"insertsubview" retains the view and sets its next responder to the receiver, which is its new superview.Views can have only one superview. “ insertsubview”保留该视图并将其下一个响应者设置为接收者,即其新的超级视图。视图只能有一个超级视图。 If view already has a superview and that view is not the receiver, this method removes the previous superview before making the receiver its new superview. 如果视图已经具有一个超级视图并且该视图不是接收者,则此方法会在使接收者成为其新的超级视图之前删除先前的超级视图。

"presentmodalviewcontroller" are tools that you can call without disrupting the current workflow and displaying a new set of views. 您可以调用“ presentmodalviewcontroller”工具,而不会中断当前工作流程并显示新的视图集。

hope it will help you to understand in basic level and for more in depth please refer Apple's documentation of UIView and ViewControllers. 希望它能帮助您从基础上理解,更深入地了解,请参阅Apple的UIView和ViewControllers文档。

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

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