有效好用组件之启动屏react-native-splash-screen
来源:互联网 发布:内增高女鞋皮面淘宝 编辑:程序博客网 时间:2024/06/05 15:01
详细的介绍react-native-splash-screen。
一、下载 React-native-splash-screen
在项目根目录打开终端运行npm react-native-splash-screen --save
二、安装(自动安装或手动安装)
自动安装终端运行:
react-native link react-native-splash-screen ||rnpm link react-native-splash-screen
手动安装在这里不多说了。去github里有详细的介绍react-native-splash-screen。
三、IOS配置.
1.在项目中 → Build Settings → Search Paths → Header Search Paths 中添加:
$(SRCROOT)/../node_modules/react-native-splash-screen/ios
2.你应该添加以下代码到AppDelegate. m
#import "AppDelegate.h"#import "RCTRootView.h"#import "SplashScreen.h" // here@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ // ...other code [SplashScreen show]; // here return YES;}@end
3.IOS可以用来自定义启动屏幕或通过 LaunchScreen.xib设置启动屏幕。
4.在.js文件的启动页中添加
import { StyleSheet, View, Text, InteractionManager, Platform,} from 'react-native'
import SplashScreen from 'react-native-splash-screen'
然后在componentDidMount中添加
this.timer = setTimeout(() => { InteractionManager.runAfterInteractions(() => { SplashScreen.hide(); navigator.resetTo({ component: HomePage, name: 'HomePage', }); });}, 2000);
1 0
- 有效好用组件之启动屏react-native-splash-screen
- (Android)解决react-native打包好后启动白屏的问题(react-native-splash-screen)
- 使用react-native-smart-splash-screen实现启动画面
- react-native-splash-screen的心酸历程
- react-native-splash-screen的坑--android
- react-native-splash-screen 不支持 react-native 0.47.1
- react-native-splash-screen--RN 0.5以上报错集合
- Android开发之启动页面Splash Screen
- 启动画面(splash screen)
- React Native]React Native组件之Navigator
- React Native之ViewPagerAndroid 组件
- React Native之ViewPagerAndroid 组件
- React Native组件之Text
- React Native 组件之Image
- React Native 组件之TextInput
- React Native组件之Button
- React-Native 组件之 Modal
- React Native 截屏组件
- android Tab案例
- 有关锚点的问题
- android ViewPager案例
- android 点击底部图片进行切换不同的Fragment
- Teamalk在服务端新增协议
- 有效好用组件之启动屏react-native-splash-screen
- android:exported 属性详解
- android ViewPager和FragmentPagerAdapter结合使用
- (spring)什么是声明式事务,回滚事务
- android Path类中的moveTo和lineTo的区别
- mysql常用命令(转载)
- retrofit2源码解析
- 欢迎使用CSDN-markdown编辑器
- android gravity & layout_gravity的区别