打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
How to add an UIViewController's view as subview

添加一个 UIViewController 作为当前视图的子视图

I feel like all of these answers are slightly incomplete, so here's the proper way to add a viewController's view as a subview of another viewController's view:

    [self addChildViewController:viewControllerToAdd];    [self.view addSubview:viewControllerToAdd.view];    [viewControllerToAdd didMoveToParentViewController:self];
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
IOS 如何从ViewController获取一个UIView上的某种或者某个控件
Container View Controller | 卢克
重写系统中的UINavigationController返回按钮的事件
通过UIView获取UIViewController
iOS开发之xib技巧介绍
[apple文档]UIViewController编程指南
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服