gpt4 book ai didi

ios - 自定义 UIModalPresentationStyle.custom : Why does presentationController(forPresented get called but not animationController(forPresented?

转载 作者:行者123 更新时间:2023-11-28 08:04:45 26 4
gpt4 key购买 nike

我正在使用 UIModalPresentationStyle.custom

在我的 UIViewControllerTransitioningDelegate 中,为什么会调用此方法:

func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController?

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

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?

最佳答案

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

present(viewController, animated: true, completion: nil)

dismiss(animated: true, completion: nil)

关于ios - 自定义 UIModalPresentationStyle.custom : Why does presentationController(forPresented get called but not animationController(forPresented?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45495017/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com