茫然和困惑 - 这是您在 iPad 应用程序中处理控制器的首选方式吗?

发布于 2024-10-05 17:22:50 字数 345 浏览 0 评论 0原文

刚刚开始使用 iPhone 和 iPad 应用程序。大量阅读,大量修改,但我认为我仍然缺少一个基本概念

一般问题:假设您正在创建一个 ipad 应用程序,您希望 1/2 的视图成为导航控制器。您是否发现自己:

A)创建 UIView、添加表格视图、添加导航栏等...并手动连接所有管道。

或者

B)创建一个导航控制器并将其添加为子视图(如果可能的话)

我试图了解经验丰富的ipad开发人员如何制作应用程序(例如ipod,屏幕被分成不同的区域,其中一些是tableviewcontrollers,导航控制器...)

感谢您阅读本文。感谢所有投入!

Just getting started with iphone and ipad apps. Lots of reading, lots of tinkering, but I think I'm still missing a basic concept

General Question: Assume you're creating an ipad app where you want 1/2 of a view to be a nav controller. Do you find yourself:

A) Creating a UIView, add tableview, add navigation bar, etc... and hookup up all the plumbing manually.

OR

B) Creating a navigation controller and adding it as a subview (if this is possible)

I'm trying to understand how experienced ipad developers make apps (like ipod, where the screen is broken up into distinct areas, with some being tableviewcontrollers, nav controllers...)

Thanks for reading this. All inputs appreciated!

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

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

发布评论

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

评论(2

本王不退位尔等都是臣 2024-10-12 17:22:50

使用导航控制器,然后将表视图控制器推到导航控制器上。看来你对这样做特别有一些疑虑,但我不太确定你对哪一部分感到不安。

Use a navigation controller, then push a tableview controller onto the navigation controller. It seems you have some qualms about doing this in particular, but I'm not quite sure which part you're shaky about.

三生一梦 2024-10-12 17:22:50

在可能的情况下,UIViews 应该从应用程序逻辑中“抽象”出来,因此选项 A 几乎每次都不是一个好主意。

如何构建应用程序将取决于其具体要求,但一般来说,这就是您将如何看待事物的结构:

设备窗口 ->导航/标签栏控制器 -> (表)查看控制器 -> SUBVIEWS (UIVIEWS)

如果您还没有看过,这对您来说是一本很好的读物

Where possible, UIViews should be 'abstracted' from application logic so option A will be a bad idea almost every time.

How you architect your App will depend on its specific requirements but in general this is how you will see things structured:

DEVICE WINDOW -> NAV/TAB BAR CONTROLLER -> (TABLE)VIEW CONTROLLER(S) -> SUBVIEWS (UIVIEWS)

This is a good read for you, in case you haven't seen it yet http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html

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