react-native-navigation 侧滑返回

如果设置topBar的visible为false的时候,侧滑返回时无效的,可以通过修改原生里面ReactNativeNavigation.xcodeproj里的
UINavigationController+RNNOptions.m

//- (void)rnn_setNavigationBarVisible:(BOOL)visible animated:(BOOL)animated {
// [self setNavigationBarHidden:!visible animated:animated];
//}

  • (void)rnn_setNavigationBarVisible:(BOOL)visible animated:(BOOL)animated {
    [self setNavigationBarHidden:!visible animated:animated];

    // enable slide-back
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
    self.interactivePopGestureRecognizer.enabled = YES;
    self.interactivePopGestureRecognizer.delegate = nil;
    }
    }

来实现侧滑返回

你可能感兴趣的:(react-native-navigation 侧滑返回)