React Native 0.60.5 react-native-splash-screen配置Android

伊曼纽尔·萨科(Emanuele Sacco)

当我在进行库的设置时,遵循以下内容:https : //github.com/crazycodeboy/react-native-splash-screen我发现在MainActivity.java中不再有onCreate方法。

MainActivity.java RN 0.60

package com.testApp;

import com.facebook.react.ReactActivity;

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 "testApp";
    }
}

因此,我尝试在getMainComponentName方法中进行设置:MainActivity.java

package com.testApp;

import com.facebook.react.ReactActivity;
import org.devio.rn.splashscreen.SplashScreen;

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() {
        SplashScreen.show(this);
        return "testApp";
    }
}

但是当我尝试编译它给我这个错误: error: cannot find symbol variable SplashScreen

有人知道该怎么做吗?

在线游戏

覆盖MainActivity内部的onCreate方法,如下所示:

@Override
    protected void onCreate(Bundle savedInstanceState){
        SplashScreen.show(this);
        super.onCreate(savedInstanceState);
    }

别忘了import android.os.Bundleimport org.devio.rn.splashscreen.SplashScreen;

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

React Native - Components not loading

来自分类Dev

React Native-NavigatorIOS

来自分类Dev

React Native-InitialProperties Android

来自分类Dev

无法启动Android的React Native

来自分类Dev

React Native Flexbox对齐

来自分类Dev

AVA + React-Native的测试配置

来自分类Dev

React Native:禁用Android抽屉

来自分类Dev

从React Native Js代码调用Android Native UI组件方法

来自分类Dev

React Native上的gRPC

来自分类Dev

React Native Android Debug Keystore

来自分类Dev

React Native,NavigationExperimental动画

来自分类Dev

如何配置React Native Android库以使用npm安装的react-native?

来自分类Dev

React Native交错渲染

来自分类Dev

React-Native项目中的“应用程序无法在60秒钟内停止运行”

来自分类Dev

React Native,Android日志。

来自分类Dev

如何在Android平台React-Native 60+上运行react-native-calendar-events?

来自分类Dev

React Nativ iOS APP正在加载黑屏,而不是我设计的主要React Native Splash

来自分类Dev

当使用react-native-splash-screen时,如何重构AppDelegate.m只加载一次应用程序?

来自分类Dev

React Native Android Navigator

来自分类Dev

React Native:禁用Android抽屉

来自分类Dev

android native和react native之间的通信

来自分类Dev

如何配置React Native Android库以使用npm安装的react-native?

来自分类Dev

React Native Android模块

来自分类Dev

如何为 React Native 配置 Linter?

来自分类Dev

React Native Android 裁剪儿童

来自分类Dev

React Native - android 和 iOS?

来自分类Dev

React Native 的 Webpack 配置

来自分类Dev

如何配置 react-native-router-flux android back history?

来自分类Dev

如何删除android的react-native-splash-screen依赖

Related 相关文章

热门标签

归档