本文介绍了将viewControllers视图添加到另一个viewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对iPhone开发完全陌生.我有两个ViewControllers
I am completely new to iPhone development. I have two ViewControllers
- ViewControllerA
- ViewControllerB
ViewControllerA是第一个,并随应用程序一起启动.
ViewControllerA is the first one and launches with the app.
我现在有另一个ViewControllerB,我想在应用程序启动时将ViewControllerB的视图作为子视图添加到ViewControllerA的视图中.
I have another ViewControllerB now I want to add view of ViewControllerB as subview to ViewControllerA's view when application launches.
推荐答案
尝试一下
ViewControllerB *vcb = [[ViewControllerB alloc] init];
[self.view addSubview:vcb.view];
这篇关于将viewControllers视图添加到另一个viewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!