我尝试了许多不同的插件和指令来做闪屏,但我得到错误时,我改变或尝试设置android-manifest或我的闪屏风格,有人能帮助我一步一步准确地设置闪屏或视频作为教程吗?
我尝试了下面的链接,但当我运行-android时,我得到了错误
https://android.jlelse.eu/change-splash-screen-in-react-native-android-app-d3f99ac1ebd1#.saf96u3bp
注意:我想要安卓
发布于 2017-02-21 23:56:34
使用模块react- 2>In - 1> -splash-screen将其安装到您的项目上,然后将文件MainActivity.java更新为
import com.reactnativecomponent.splashscreen.RCTSplashScreen;
import android.os.Bundle;
import android.content.Intent;
in the onCreate method delete the method and copy the code below
@Override
protected void onCreate(Bundle savedInstanceState) {
RCTSplashScreen.openSplashScreen(this);
super.onCreate(savedInstanceState);
}在MainApplication.java文件中
import com.reactnativecomponent.splashscreen.RCTSplashScreenPackage;
replace the getPackages() method with the following
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new MapsPackage(),
new RCTSplashScreenPackage()
);
}现在在react本机应用程序的登录页面中
import SplashScreen from 'react-native-smart-splash-screen'
in the lifecycle method componentWillMount() add the following as:
componentDidMount(){
SplashScreen.close(SplashScreen.animationType.scale, 2000, 800)
}如果有问题,请访问此存储库
https://github.com/UjjwalNepal/Dental
https://github.com/react-native-component/react-native-smart-splash-screen
在gradle设置中也添加上面链接中提到的依赖项,并在android/app/build.gradle中添加上面链接中提到的依赖项
https://stackoverflow.com/questions/42345047
复制相似问题