拇指向下的NavigationController - 左视图和右视图从rootViewController 滚动?

发布于 2024-10-09 16:39:15 字数 255 浏览 7 评论 0原文

我是来自 Turkiye 的新手 ios 开发人员。所以请原谅我的英语。 我想了解如何在 NavigationController 上做到这一点?

****LeftSideControllerView -----RootControllerView-----RightSideControllerView****

我想要这样的滚动吗?这不可能吗?我该怎么办?

I am newbie ios developer from Turkiye. So excuse me for my eng.
I want to learn how can do this on NavigationController?

****LeftSideControllerView -----RootControllerView-----RightSideControllerView****

I want scroll like this? is it impossible? how should I do??

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

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

发布评论

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

评论(3

红ご颜醉 2024-10-16 16:39:15

您可以通过以下方式做到这一点。

1.使用LeftSideControllerView创建一个NavigationController。

LeftSideControllerView *firstVC = [[LeftSideControllerView alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstVC];

2.创建中心视图控制器并将其推送到导航控制器(不带动画)。

SecondViewController *secondVC = [[SecondViewController alloc] init];
[[self navigationController] pushViewController:secondVC animated:NO];

这里的 SecondViewController 是您在问题中指定的 RootControllerView 。

3.从 SecondViewController 中,您可以推送 RightSideControllerView。

这是一种方法,但可能不是正确的方法。

You can do that in the following way.

1.Create a NavigationController with LeftSideControllerView.

LeftSideControllerView *firstVC = [[LeftSideControllerView alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstVC];

2.Create the Center View Controller and push it to the navigation controller (without the animation).

SecondViewController *secondVC = [[SecondViewController alloc] init];
[[self navigationController] pushViewController:secondVC animated:NO];

Here SecondViewController is the RootControllerView you specified in your question.

3.From the SecondViewController you can push the RightSideControllerView.

This is one way of doing it, but may not be the right way of doing it.

夜巴黎 2024-10-16 16:39:15

一种方法是使用宽度为屏幕三倍的 UIScrollView,并启用分页,因此感觉就像主屏幕。然后在 UISCrollView 的每个段中拥有三个 UIView,分别对应于 LeftSideControllerView、MiddleControllerView 和 RightSideControllerView。注意:您可能必须为中间新建一个新的,因为 RooControllerView 将处理大的 UIScrollView。

One way of doing it would be having a UIScrollView with a width of three times the screen, and enable paging, so it feels like the homescreen. Then have three UIViews in each segment of the UISCrollView which correspond to LeftSideControllerView, MiddleControllerView, and RightSideControllerView. Note: You may have to make a new new for the middle, because the RooControllerView will handle the large UIScrollView.

山川志 2024-10-16 16:39:15

NAvigation 将因此视图中只有一个视图控制器。它总是从根视图控制器开始。

执行场景的一种方法是将 LeftViewController 设置为 RootViewController。在下一行中推送第二个视图控制器,您希望在开始时将其作为可见视图控制器。然后在需要时按下 Rightviewconteoller。要使左视图控制器使用 poptorootviewcontroller 方法。

第二种方法是使用动画编号属性推动 Leftviewcontroller。

[[self navigationController] PushViewController:Leftviewcontroller 动画:NO];

使用您的自定义动画,例如 leftviewcontroller 从左侧移动。

NAvigation will so only one view controller in the view. It always starts with Root View Controller.

One way for doing your scenario is make the LeftViewController as RootViewController.in the next line push the secondviewcontroller which u like to have as a visible viewcontroller at the begining. then push the Rightviewconteoller whenever u need. To make the left viewcontroller use poptorootviewcontroller method.

the second way is Push the Leftviewcontroller by using the property animated no.

[[self navigationController] pushViewController:Leftviewcontroller animated:NO];

use ur custom animation like leftviewcontroller moves from the left.

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