react-navigation在抽屉外面点击时抽屉不靠近

https://reactnavigation.org/docs/en/getting-started.html#installation

https://github.com/react-navigation/react-navigation/issues/5540;

yarn add react-native-gesture-handler

react-native link react-native-gesture-handler

MainActivity.java

package com.reactnavigation.example;

import com.facebook.react.ReactActivity;

+ import com.facebook.react.ReactActivityDelegate;

+ import com.facebook.react.ReactRootView;

+ import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

@Override

protected String getMainComponentName() {

  return "Example";

}

+@Override

+ protected ReactActivityDelegate createReactActivityDelegate() {

  + return new ReactActivityDelegate(this, getMainComponentName()) {

  + @Override

  + protected ReactRootView createRootView() {

    + return new RNGestureHandlerEnabledRootView(MainActivity.this); + } + };

  + }

}

猜你喜欢

转载自www.cnblogs.com/boonook/p/10381605.html