问题
I have a UIViewController
vc1 which is pushed after UIViewController
vc2.
Both vc1 and vc2 are with transparent background.
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.
How can i disable/remove UIParallaxDimmingView
or set it transparent?
回答1:
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;
}
}
来源:https://stackoverflow.com/questions/48081742/how-to-remove-uiparallaxdimmingview-in-pop-uiviewcontroller