开发者

What is a modal view?

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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜