首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自定义UIModalPresentationStyle.custom:为什么presentationController(forPresented被调用而animationController不被调用)(forPresented?

自定义UIModalPresentationStyle.custom:为什么presentationController(forPresented被调用而animationController不被调用)(forPresented?
EN

Stack Overflow用户
提问于 2017-08-03 21:45:39
回答 1查看 615关注 0票数 1

我在用UIModalPresentationStyle.custom

在我的UIViewControllerTransitioningDelegate中,为什么调用这个方法:

代码语言:javascript
复制
func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController?

但是这些函数都没有被调用:

代码语言:javascript
复制
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning?

func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning?

func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?

func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-03 21:45:39

在调用时,确保将animated Bool设置为true

代码语言:javascript
复制
present(viewController, animated: true, completion: nil)

代码语言:javascript
复制
dismiss(animated: true, completion: nil)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45495017

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档