xcode 在objective-c中添加一个视图控制器作为另一个视图控制器的子级
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9198657/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
adding one view contoller as a child of another view controller in objective-c
提问by jessy
I need to know how to add one view contoller as a child of another view controller in objective-c. As of now I am presenting a view controller as a modal of the rootview controller. But I want to change it now. I have 2 view controllers which I am presenting as modals of root view controller. But how can I present them in a different way? How does this parent-children concept work? Please give me some references.
我需要知道如何在objective-c 中添加一个视图控制器作为另一个视图控制器的子项。到目前为止,我将视图控制器呈现为 rootview 控制器的模态。但我现在想改变它。我有 2 个视图控制器,我将它们呈现为根视图控制器的模态。但是我怎样才能以不同的方式呈现它们呢?这个亲子概念是如何运作的?请给我一些参考。
回答by Will Pragnell
To start with you should read the following:
首先,您应该阅读以下内容:
View Controller Programming Guide
I believe that between the two of them you should be able to learn most, if not all, of what you need to learn about UIViewControllers and view hierarchys.
我相信在这两者之间,您应该能够了解大部分(如果不是全部)您需要了解的 UIViewControllers 和视图层次结构。