详细视图仅显示在屏幕的表格区域中?

发布于 2024-11-29 07:43:01 字数 1382 浏览 2 评论 0原文

我希望能够显示表格的详细视图,但不推送新屏幕,而只显示表格所在的详细视图。

如果确实可能的话,最好的设置方法是什么?

------------------------------------
|                                  |
|           nav bar or tool bar    |
------------------------------------
|                                  |
|        this area stays static    |
|                                  |
------------------------------------                ---------------------------------
|                                  |                |                               |
|                                  |                |                               |
|                                  |                |                               |
|           table…                 |                |  new uitableview pushed.      |
|                                  | cell clicked-> | only the table area changes   |
|                                  |                |                               |
|                                  |                |                               |
|                                  |                |                               |
------------------------------------                ---------------------------------
|      |      |      |      |      |
|      |      |      |      |      | < tab bar
|      |      |      |      |      |
------------------------------------

I'd like to be able to show the detail view of a table, but not push a new screen, but only show the detail view where the table is.

What's the best way of setting this up.. if it is actually possible?

------------------------------------
|                                  |
|           nav bar or tool bar    |
------------------------------------
|                                  |
|        this area stays static    |
|                                  |
------------------------------------                ---------------------------------
|                                  |                |                               |
|                                  |                |                               |
|                                  |                |                               |
|           table…                 |                |  new uitableview pushed.      |
|                                  | cell clicked-> | only the table area changes   |
|                                  |                |                               |
|                                  |                |                               |
|                                  |                |                               |
------------------------------------                ---------------------------------
|      |      |      |      |      |
|      |      |      |      |      | < tab bar
|      |      |      |      |      |
------------------------------------

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

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

发布评论

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

评论(4

滿滿的愛 2024-12-06 07:43:01

如果您想要类似于推送 UIViewController 的效果,我想您可以将 tableview 动画化并同时将新视图动画化到位。我认为没有办法使用实际的 UINavigationController 机制来做到这一点,因为它用新的视图控制器的视图替换了 UINavigationController 堆栈上的当前视图。

If you want an effect similar to pushing a UIViewController I guess you could animate the tableview out and animate the new view into position at the same time. I don't think there's a way to do it using the actual UINavigationController mechanism, as it replaces the current view on the UINavigationController's stack with the new viewcontroller's view.

故笙诉离歌 2024-12-06 07:43:01

我建议使用两种方法:

  1. uitableView 插入到 UIView 中,这样您将始终可以引用保存 uitable 视图的容器。此外,您只需要管理此表视图的子子视图的框架大小。在您的情况下,它将是第一个 uitableview ,单击按钮后可以使用 父容器 的引用添加下一个子视图。
  2. 或者,您可以使用一个宏,其中包含 uitableview 框架相对于父 UIView 的位置。在插入另一个子视图时,您可以设置框架,从而给人一种覆盖在基本 uitableview 之上的印象。

I would suggest two methods:

  1. Insert the uitableView into a UIView, this way you will always have reference to a container which holds the uitable view. Also you need to just manage the frame sizes of the child subviews of this table view. In your case it would be the first uitableview and on button click the next subview can be added using the reference of the parent container.
  2. Alternatively you can have a macro which has the positions of the uitableview's frame with respect to the parent UIView. On inserting another subview you can set the frame therby giving an impression of overlaying above the base uitableview.
筑梦 2024-12-06 07:43:01

只需在表视图顶部添加另一个视图并将其隐藏即可。设置内容并在需要时取消隐藏。

Just have another view on top of the table view and make it hidden. Set the contents and unhide it when needed.

心如狂蝶 2024-12-06 07:43:01

在我看来,解决此问题的最佳方法是使用不显示导航栏且不填充屏幕的 UINavigationController。因此,您的静态区域只是普通的 UIView,但您的表格视图实际上位于 UINavigationController 内,但看起来像是一个普通的表格 - 因为导航栏是隐藏的。

这意味着您可以将“动态”内容推送到 UINavigationController,这将使屏幕的该部分产生动画效果,但屏幕的其余部分将保持静态。

The best way, in my opinion of resolving this is to use a UINavigationController that doesn't have its nav bar showing and doesnt fill the screen. So, your static areas are just plain UIViews, but your table view is actually inside a UINavigationController, but seems like it is a normal table - as the navigation bar is hidden.

This means you would push the "dynamic" content to the UINavigationController and that would animate that section of the screen, but the rest of the screen would remain static.

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