如何在弹出的UIViewController中删除UIParallaxDimmingView? [英] How to remove UIParallaxDimmingView in pop UIViewController?
问题描述
我有一个 UIViewController
vc1 ,它被推送到 UIViewController
vc2 之后. vc1 和 vc2 都具有透明背景.
I have a UIViewController
vc1 which is pushed after UIViewController
vc2.
Both vc1 and vc2 are with transparent background.
问题:当我尝试使用交互式弹出手势(从边缘平移)弹出 vc2 时,在我的视图堆栈中会出现神秘的 UIParallaxDimmingView
,这会使我的堆栈变暗(在透明视图控制器下有一个背景图像).松开手指,取消或完成过渡后,它将再次变得清晰/透明.
Problem:
When I try to pop vc2 with interactive pop gesture (pan from edge), in my view stack appears mysterious UIParallaxDimmingView
which darkens my stack (under transparent view controllers there is a background image).
As soon as I release finger, cancel or finish transition it becomes clear/transparent again.
如何禁用/删除 UIParallaxDimmingView
或将其设置为透明?
How can i disable/remove UIParallaxDimmingView
or set it transparent?
推荐答案
如果在尝试使用交互式弹出手势弹出VC(从边缘平移)时推送VC(仍处于动画状态),则该应用程序可能被冻结.这可以帮助您:
If it is pushing a VC(still animating) when you try to pop VC with interactive pop gesture(pan from edge), the app may be frozen. This can help you :
/ 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;
}
}
这篇关于如何在弹出的UIViewController中删除UIParallaxDimmingView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!