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); + } + };

  + }

}

上一篇:组装者模式在React Native项目中的一个实战案例


下一篇:Codeforces Round #562 (Div. 2)