Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 UIViewController 的modalPresentationStyle属性设置问题 #2

Closed
liwenDeng opened this issue Mar 15, 2016 · 4 comments
Closed

Comments

@liwenDeng
Copy link

Modal转场实践 中提到

UIKit 已经为 Modal 转场实现了多种效果,当 UIViewController 的modalPresentationStyle属性为.Custom 或.FullScreen时,我们就有机会定制转场效果,此时modalTransitionStyle指定的转场动画将会被忽略。

我理解的是如果要定制自定义的转场效果,必须将modalPresentationStyle 设置为.Custom 或者.FullScreen。但是我尝试将 modalPresentationStyle 设置为.Custom 和 .FullScreen 以外的其他值时,发现也会执行自定义的转场效果,不知道我这里是否理解错误了?

@seedante
Copy link
Owner

其实这里的确是可以设置为其他值的也依然能够实现自定义的转场动画,实际上,当我们在转场代理里提供了动画控制器后,系统就会认为交给你负责转场了,Modal 转场在这一块需要设置的参数更多,内部的实现并没有过滤掉这个,当发现你提供了转场代理以及动画控制器后还是执行了你自定义的方案。不过我当时试验发现后期会有些瑕疵,不知道为何我没有把这个也记录下来,现在也不记得哪里会有问题,唯一确定的是在与 UIPresentationController 配合时该属性必须为.Custom。

@seedante
Copy link
Owner

简单试了下,在.PageSheet, .FormSheet模式下,会对动画控制器决定的布局产生影响,这两种模式下都没有移除 presentingView,这点和.Custom 模式下相同。

@coderMR
Copy link

coderMR commented Mar 17, 2016

感谢分享

@seedante
Copy link
Owner

Close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants