【发布时间】:2019-08-05 11:29:01
【问题描述】:
我需要将 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?
【问题讨论】:
-
上面的代码有什么错误吗? stackoverflow.com/help/how-to-ask
-
没有错误,实现是唯一似乎可以解决问题但没有解决问题的方法。我将代码添加到该导航控制器的根目录
-
你想让它变白吗?对不起,亲爱的,但你的问题对我来说仍然有点混乱
-
是的,我想让它变成白色或非彩色。
标签: ios swift uinavigationcontroller