mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-03-29 17:18:33 +08:00
Fix stack with gestureEnabled=false on iOS (#283)
#254 without breaking changes Instead of moving gestureEnabled to the screen we find the header config subview.
This commit is contained in:
committed by
Michał Osadnik
parent
ce819f6356
commit
27ef6dc900
@@ -102,7 +102,16 @@
|
||||
RCTRootContentView *rootView = (RCTRootContentView *)parent;
|
||||
[rootView.touchHandler cancel];
|
||||
|
||||
return _controller.viewControllers.count > 1;
|
||||
UIView *topView = _controller.viewControllers.lastObject.view;
|
||||
RNSScreenStackHeaderConfig *config = nil;
|
||||
for (UIView *subview in topView.reactSubviews) {
|
||||
if ([subview isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
|
||||
config = (RNSScreenStackHeaderConfig*) subview;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return _controller.viewControllers.count > 1 && (config == nil || config.gestureEnabled);
|
||||
}
|
||||
|
||||
- (void)markChildUpdated
|
||||
|
||||
@@ -267,7 +267,6 @@
|
||||
}
|
||||
|
||||
[navctr setNavigationBarHidden:shouldHide animated:YES];
|
||||
navctr.interactivePopGestureRecognizer.enabled = config.gestureEnabled;
|
||||
#ifdef __IPHONE_13_0
|
||||
if (@available(iOS 13.0, *)) {
|
||||
vc.modalInPresentation = !config.gestureEnabled;
|
||||
|
||||
Reference in New Issue
Block a user