iPhone Cocoa Touch:向视图添加附加视图或子视图

发布于 2024-09-18 16:45:26 字数 358 浏览 1 评论 0 原文

根据我所读到的内容,大多数时候我们在为 iPhone 创建应用程序时都会处理视图。将子视图添加到表视图,将表视图添加到 UIView...等

所以我的问题是如何混合和匹配所有视图?假设我首先使用 Xcode(标签栏应用程序)中的模板,它基本上给了我 2 个“部分”,一个带有 2 个 UIView 的标签栏控制器。我修改了 UIView 的代码,这样我最终得到了 2 个表视图。现在,每当我点击表格视图上的单元格时,我都想向表格视图添加额外的视图。我创建了一个新的视图控制器,调用firstDetailView并将它们连接起来,但没有任何反应。令人惊讶的是,该应用程序没有崩溃。

我可能做错了或者错过了一些事情。我是编程新手。任何帮助将不胜感激。

谢谢。

From What I understand based on what I read, most of the time we will be dealing with view when creating apps for the iPhone. Adding sub view to table view, adding table view to a UIView....etc

So my question is how do I go about mix and match all the views? Let say I start off by using a template in Xcode (Tab Bar Application) which basically give me 2 "section", a tab bar controller with 2 UIView to began with. I modified the code for the UIView so that I end up with 2 table view. Now I wanted to an add additional view to the table view whenever I tap on a cell on the table view. I create a new view controller call firstDetailView and hook them up but nothing happen. Surprisingly the app doesn't crash.

I might do it wrongly or have missed something. I am a newbies to programming. Any help would be appreciated.

Thanks.

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

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

残月升风 2024-09-25 16:45:26

如果您想处理由视图控制器处理的不同视图,您应该阅读 视图控制器编程指南

尝试第一手阅读Apple文档,它们非常好,所有基本内容都在那里解释。

If you want to deal with different views which are handled by a view controller you should read the View Controller Programming Guide

  • Navigation through views will be done with a Navigation Controller (Guide here)
  • Tab bar's are explained as well (Guide here)

Try to read the Apple documentation in the first hand, they are pretty good and all basic stuff is explained there.

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