【发布时间】:2019-09-05 23:28:07
【问题描述】:
最近我用 React Native 0.60 启动了一个应用程序,第一次构建运行良好,但是在安装和配置 react-native-gesture-handler 后,应用程序一直在我的模拟器中停止。它没有错误,只是一直停止。我所做的唯一更改是添加这些包。
这是我的 MainActivity.java,带有手势处理程序所需的配置
package com.ggwp;
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 {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "ggWP";
}
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
【问题讨论】:
标签: android reactjs react-native