iOS:采取哪种方法 - x 动态 UITableView 数量

发布于 2024-12-28 21:08:44 字数 504 浏览 3 评论 0原文

我正在尝试找出针对我当前情况采取的最佳方法。 我有一个带有导航栏控制器的应用程序,在某一时刻需要呈现/显示 x 个表格视图。(x 表示该数字是通过与服务器通信决定的)...每个表格视图都代表一个类或一个团体...(这可以是学校课程或幼儿园课程) 好吧...那么...只有一个表视图应该可见/处于焦点,但其他表视图应该可以从同一视图访问...

例如,视图已呈现。显示了 A 类的表格视图。用户可以滑动以获得 B 类

我一直在考虑不同的方法,但我无法找出最好的方法...

  1. 我考虑使用包含 x 表视图的滚动视图,其中只有一个在 a 处可见时间,其他的可以在视图中滚动...但是,经过一些研究后,苹果似乎建议您不要将表视图放置在滚动视图中,因为滚动可能会相互干扰...
  2. 使用选项卡导航栏...我的研究再次告诉我应该放置导航栏在选项卡栏中,而不是相反...我只想在此视图上有一个选项卡栏,而不是在应用程序的早期。
  3. 使用自定义选项卡栏可以更好地支持我的“需求”...

任何想法??

I'm trying to figure out the best approach to take in my current situation.
I have an app with a navigation bar controller that at one point needs to present/show x number of table views.(x meaning that the number is decided by communicating with a server)... The table views will each represent e.g a class or a group... (this could be school classes or kindergarden classes)
Okay... So... Only one table view should be visible/in focus, but the others should be accessible from the same view...

E.g. The view is presented. A table view for class A is shown. The user can swipe to get class B

I've been considering different approaches, but I can't figure out the best approach to this...

  1. I considered using a scroll view containing the x table views, where only one was visible at a time, and the others could be scrolled in view... But, after doing some research, it seems that Apple recommends that you shouldn't place table views in scroll views, because the scrolling can interfere with each other..
  2. Using a tab bar... Again, my research told me that the navigation bar should be placed in the tab bar, and not the other way around... And I only want a tab bar on this view, and not earlier in the app..
  3. Use a custom tab bar that better supports my "needs"...

Any ideas??

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

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

发布评论

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

评论(1

音盲 2025-01-04 21:08:44

在我看来,最重要的是只有一个 UITableView 必须是可见的。最好的解决方案(即最简单的)是第一个 UITableView 及其 UITableviewController 列出从服务器检索的所有类/类别 A、B、...,以及辅助 UITableView(即控制器/+ tableView) 将显示给定类别项目的详细列表。您还可以继续深入数据树的其他子表视图。

我建议在选择单元格时使用 UINavigationController 来推送/弹出 tableView。

在一个独特的容器视图中堆叠多个 UITableView 似乎过于复杂,并且可能会导致棘手和/或不需要的状态。

In my opinion the most important thing is that only one UITableView have to be visible. The best solution (ie the simplest) is a first UITableView with its UITableviewController that lists all the classes/categories A,B,.. retrieved from the server, and a secondary UITableView (ie controller /+ tableView) that will display the detailed list for a given class of items. You may also continue to drill down your data tree other sub-tableViews.

I recommend to use a UINavigationController to push/pop your tableViews when a cell is selected.

Stacking several UITableViews in a unique container view seems too much complicated and may lead to tricky and/or unwanted states.

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