当我按照 react-native-navigation v2 初始设置的第 6 步操作时,我在我的项目中使用 react-native-navigation v2
然后我在MainActivity.java中完成以下更改
-import com.facebook.react.ReactActivity;
+import com.reactnativenavigation.NavigationActivity;
-public class MainActivity extends ReactActivity {
+public class MainActivity extends NavigationActivity {
- @Override
- protected String getMainComponentName() {
- return "yourproject";
- }
}
当我按照react-native-splash-screen中的初始设置步骤进行操作时
import android.os.Bundle; // here
import com.facebook.react.ReactActivity;
// react-native-splash-screen >= 0.3.1
import org.devio.rn.splashscreen.SplashScreen; // here
// react-native-splash-screen < 0.3.1
import com.cboy.rn.splashscreen.SplashScreen; // here
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this); // here
super.onCreate(savedInstanceState);
}
// ...other code
}
然后有冲突,因为MainActivity现在扩展 NavigationActivity而不是ReactActivity,并且要遵循 react-native-splash-screen 的初始设置,我需要覆盖 ReactActivity,我现在应该做什么,添加 react-native-splash-screen使用 react-native-navigation v2?