gpt4 book ai didi

ios - 找不到容器 View 对象

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:34:38 24 4
gpt4 key购买 nike

我是唯一一个在 Xcode 7 中找不到 Container View 对象的人吗??

我以前用过这个功能,现在我想重新实现它,但我找不到它。

我想知道 maybe now 是否已被弃用,但它仍在 Apple 官方文档中。

https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html

enter image description here

我想做的是重现 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com