我是唯一一个在 Xcode 7 中找不到 Container View 对象的人吗??
我以前用过这个功能,现在我想重新实现它,但我找不到它。
我想知道 maybe now 是否已被弃用,但它仍在 Apple 官方文档中。
我想做的是重现 Snapchat 导航 View ,我有一个带有分页的 scrollView,每个页面上将包含 3 个 View Controller 。我想使用容器来添加每个 subview Controller 。
最佳答案
为了回应用户 Raj Tandel 在评论中发布的答案,显然您不能将容器 View 与 xibs 一起使用。
Here is a great thread这解释了原因:
It is not possible as it needs to deal with parent and child view relationship which is not meant for xib(s)
解决方案是“只需将一个普通的 UIView 添加到 xib 以充当容器。然后在代码中,将您的 subview Controller 的 View 添加为容器的 subview ”
有关更多信息,请单击上面包含的链接(努力保持良好的答案和主题的连续性,而不是重复已经存在的内容)
关于ios - 找不到容器 View 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36306688/