gpt4 book ai didi

ios - 如何删除弹出 UIViewController 中的 UIParallaxDimmingView?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:29:39 27 4
gpt4 key购买 nike

我有一个 UIViewController vc1 被推送到 UIViewController vc2 之后。vc1vc2都是透明背景

问题:当我尝试使用交互式弹出手势(从边缘平移)弹出 vc2 时,在我的 View 堆栈中出现神秘的 UIParallaxDimmingView 这使我的堆栈变暗(在透明 View Controller 下有一个背景图片)。一旦我松开手指、取消或完成过渡,它就会再次变得清晰/透明。

如何禁用/删除 UIParallaxDimmingView 或将其设置为透明?

最佳答案

如果当您尝试使用交互式弹出手势(从边缘平移)弹出 VC 时它正在推送 VC(仍在动画),则应用程序可能会被卡住。这可以帮助您:

/ set gesture no when pushViewController /
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.interactivePopGestureRecognizer.enabled = NO;
}

[super pushViewController:viewController animated:animated];
}

/ set gesture yes when showViewController /
- (void)navigationController:(UINavigationController )navigationController didShowViewController:(UIViewController )viewController animated:(BOOL)animated
{
if ([navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
navigationController.interactivePopGestureRecognizer.enabled = YES;
}

/ if rootViewController, set delegate nil /
if (navigationController.viewControllers.count == 1) {
navigationController.interactivePopGestureRecognizer.enabled = NO;
navigationController.interactivePopGestureRecognizer.delegate = nil;
}
}

关于ios - 如何删除弹出 UIViewController 中的 UIParallaxDimmingView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48081742/

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