iOS 应用程序 UI 的层次结构

发布于 2024-09-27 05:12:58 字数 278 浏览 1 评论 0原文

我在阅读有关 CALayers、UIViews 和 View Controllers 的内容时感到困惑。有人可以解释一下它们之间的关系(并包括我可能错过的任何内容吗?)。

我对可能具有多个层的视图特别感兴趣。这是否意味着视图控制器有多个 UIView,或者 UIView 有多个 CALayer?或者,UIView 是否有另一个 UIView 子视图?

谢谢你们的帮助。

编辑:我想我应该提到我将以编程方式设置这些人,这就是为什么我需要真正理解这些关系,而不是依赖 IB 为我做所有繁重的工作。

I am getting confused reading about CALayers, UIViews and View Controllers. Can someone explain the relationship each of those have to each other (and include anything I might have missed?).

I am particularly interested in a View that may have more than one layer. Does that mean the the View Controller has multiple UIViews or that the UIView has more than one CALayer? Or, does the UIView have another UIView subview?

Thanks for the help guys.

Edit: I guess I should have mentioned I am going to be setting these guys up programmatically, which is why I need to actually understand the relationships instead of relying on IB to do all the heavy lifting for me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文