在没有 UITabBar 或 UINavigationBar 的 iOS 中编排多个视图的最佳方法?

发布于 2024-09-26 08:48:40 字数 402 浏览 0 评论 0原文

我正在尝试创建一个带有欢迎屏幕的 iPhone 应用程序,该应用程序会导致两到三个完全不同的 UI;一旦你深入研究了其中一个,你就不会再对其他的有太多用处,而且每一个本身都相当复杂。

设计师都是网页类型,看起来“导航”范式最接近他们想要的,但面包屑式导航栏却不是。

  1. 如果我设置了 UINavigationController,我可以使用视图中的任意按钮来驱动它吗?
  2. 一般来说,是否可以通过编程方式交换视图的内容?
  3. 如果是的话,我需要注意什么? (例如,在 Java 中,如果更改 JPanel 的内容,则需要确保它得到重新验证和重新绘制。)

这里是来自 Java 世界的 iOS 新手,非常感谢超明确的建议。使用 Monotouch,但很乐意接受 Obj-C 的帮助和翻译。 :)

I'm trying to create an iPhone app with a welcome screen that leads to two or three pretty disparate UIs; once you've drilled into one you're not going to have much use for the others, and each one is itself fairly complicated.

The designers are all web types and it looks like the "navigation" paradigm is the closest to what they want, but the breadcrumb-style navigation bar isn't.

  1. If I set up a UINavigationController, can I then drive it with arbitrary buttons in the views?
  2. And in general, is it possible to swap out the contents of a view programmatically?
  3. And if so, what do I need to watch out for? (E.g., in Java if you change the contents of a JPanel you need to make sure it gets revalidated and repainted.)

Total iOS newbie here, coming from the Java world, super-explicit advice much appreciated. Using Monotouch, but happy to take Obj-C help and translate. :)

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

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

发布评论

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

评论(1

森末i 2024-10-03 08:48:40

很难告诉您如何仅使用这些信息来设计应用程序,因此我假设您想要进行像 UINavigation 控制器这样的深入操作。

1- 是的,您可以使用 PushViewController() 和 PopViewController() 等方法从其他 ViewController 驱动 UINavigationController。如果需要,您还可以隐藏工具栏或某些工具栏按钮。您可以这里找到一些很棒的示例

2- 是的,您可以更改视图的内容。视图包含其他视图,您可以根据需要添加和删除它们。

3- 要注意的主要事情是确保更新视图的调用是在 InvokeOnMainThread(()=>{}) 调用内完成的。 更多信息请参见此处。

It's hard to tell you how to design your app with only that information, so I'll assume you want to do a drill-down thing like a UINavigation controller.

1- Yes, you can drive the UINavigationController from other ViewControllers, using methods like PushViewController() and PopViewController(). You can also hide the toolbar or some of the toolbar buttons if you want. You can find some great examples here.

2- Yes, you can change contents of a view. Views contains other views and you can add and remove them as you want.

3- The main thing to be careful about is to make sure that calls that update the view are done inside a InvokeOnMainThread(()=>{}) call. More info here.

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