什么是模态视图?

发布于 2024-10-22 07:12:37 字数 355 浏览 3 评论 0原文

我想为设置页面制作自下而上或自上而下的动画。 (通常是 pushViewController
并发现自下而上可以用..

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;

有些人似乎建议你坚持Apple的HIG(Apple肯定将左右动画作为默认的pushViewController)并且不要使用模态视图。

我想知道什么是模态视图,并想知道人们使用哪些其他动画来推送/弹出 viewController?

谢谢。

I wanted to do bottom-up or up-bottom animation for settings page. (which would normally be pushViewController)
And found out that bottom-up can be done with..

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;

Some people seem to suggest that you stick to Apple's HIG (Apple surely made left-right animation as default pushViewController) and do not use modal view.

I wonder what is modal view and wonder what other animations people use for pushing/popping viewController?

Thank you.

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

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

发布评论

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

评论(1

口干舌燥 2024-10-29 07:12:37

模态视图会阻止与任何其他 UI 交互,直到它被关闭为止。

模态视图控制器只是一个以模态方式呈现的 UIViewController 类。当视图控制器以模态方式呈现时,它会覆盖现有视图的任何内容(如果指定,则使用动画),并且用户在返回到他们正在做的事情之前大多数会以某种方式关闭此视图。

要以模态方式呈现视图控制器,可以使用以下方法:

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;

每当我想使用模态视图(即在继续执行其他操作之前必须完成的视图)时,我会调用此方法并使用 Apple 的标准动画来呈现视图控制器(请注意,上面的实例方法不包含指定视图动画方式的参数 - 因为 Apple 有执行此操作的标准方法)。

A modal view prevents interaction with any other UI until it is dismissed.

A modal view controller is simply a UIViewController class that is presented modally. When the view controller is presented modally it covers whatever the existing view was (using an animation if specified) and the user most somehow dismiss this view before they can return to what they were doing.

To present a view controller in a modal fashion, you can use the method:

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;

Whenever I want to use a modal view (i.e. a view that must be completed before continuing with anything else) I would call this method and use Apple's standard animation for presenting a view controller (notice that the instance method above does not include a parameter to specify how the view is animated - because Apple has a standard way of doing this).

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