gpt4 book ai didi

ios - 如何在将 View Controller 推送到另一个 View Controller 时处理 UIParallaxDimmingView?

转载 作者:行者123 更新时间:2023-11-28 05:39:29 42 4
gpt4 key购买 nike

我需要将 UIParallaxDimmingView 设为白色或透明。

vc1 的白色背景受此 UIParallaxDimmingView 的影响,使其在动画结束后过渡到 vc2 时呈现浅灰色,vc2 获得其白色背景。

我进行了研究,找到了这段代码,但对我不起作用。

func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
if (navigationController.viewControllers.count > 1)
{
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
navigationController.interactivePopGestureRecognizer?.isEnabled = true;
}
else
{
self.navigationController?.interactivePopGestureRecognizer?.delegate = nil
navigationController.interactivePopGestureRecognizer?.isEnabled = false;
}
}

Mysterious _UIParallaxDimmingView. What is it?

App freeze on ios 8 when push or pop

iOS App Freezes on PushViewController

更新这是最初的问题 How to remove UIParallaxDimmingView in pop UIViewController?

最佳答案

swift 5

例如,在推送 viewController 时,只需使用 false 移除动画。简单易行。

navigationController?.pushViewController(YourController, animated: false)

关于ios - 如何在将 View Controller 推送到另一个 View Controller 时处理 UIParallaxDimmingView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57357679/

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