什么是模态视图?
我想为设置页面制作自下而上或自上而下的动画。 (通常是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模态视图会阻止与任何其他 UI 交互,直到它被关闭为止。
模态视图控制器只是一个以模态方式呈现的 UIViewController 类。当视图控制器以模态方式呈现时,它会覆盖现有视图的任何内容(如果指定,则使用动画),并且用户在返回到他们正在做的事情之前大多数会以某种方式关闭此视图。
要以模态方式呈现视图控制器,可以使用以下方法:
每当我想使用模态视图(即在继续执行其他操作之前必须完成的视图)时,我会调用此方法并使用 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:
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).