React Native Splashscreen实现
来源:互联网 发布:软件开发认证证书 编辑:程序博客网 时间:2024/05/17 20:02
index.android.js
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, { Component } from 'react';var TimerMixin = require('react-timer-mixin');import { AppRegistry,} from 'react-native';import NavigationExperimental from 'react-native-deprecated-custom-components';var SplashScreen = require('./SplashScreen');export default class EDS extends Component { render() { var defaultComponent = SplashScreen; return ( <NavigationExperimental.Navigator initialRoute={{ name: 'Splash', component: defaultComponent }} configureScene={(route) => { return NavigationExperimental.Navigator.SceneConfigs.HorizontalSwipeJumpFromRight; } } renderScene={(route, navigator) => { let Component = route.component; return <Component {...route.params} navigator={navigator} /> } } /> ); }}AppRegistry.registerComponent('EDS', () => EDS);
SplashScreen.js
'use strict'import React, { Component } from 'react';import {AppRegistry,Image,StyleSheet} from 'react-native';var Animated = require('Animated');import MainPage from './MainPage.js';export default class SplashScreen extends Component {constructor(props) {super(props);var {navigator} = props;setTimeout(() => {navigator.replace({ name: 'MainPage', component: MainPage })}, 1000);}render() {return(<Image source={require('./res/splash.png') } style={styles.backimagestyle}/>);}}var styles = StyleSheet.create({backimagestyle: {flex: 1,justifyContent: 'center',alignItems: 'center',width: null,height: null,resizeMode: 'cover'}});module.exports = SplashScreen;
MainPage.js
'use strict'import React, { Component } from 'react';import { AppRegistry, StyleSheet, Text, View} from 'react-native';//var MainPage = React.createClass({ export default class MainPage extends Component { render() { return ( <View> <Text> hello world </Text> </View> ); }}module.exports = MainPage;
阅读全文
0 0
- React Native Splashscreen实现
- React Native Button实现
- react-native实现popwindow
- react-native实现轮播图
- Cocoa下实现SplashScreen
- SplashScreen实现加载数据
- Mymusic SplashScreen界面实现
- React-native简单button实现
- react native 实现原理解析
- React Native 实现二维码扫描
- React Native 实现二维码扫描
- React Native 热更新实现
- React-Native自定义PopupWindow实现
- react native Modal 实现ActionSheet
- react-native 实现上传功能
- React-Native自定义PopupWindow实现
- react-native实现文件上传
- React Native实现二维码扫描
- react-navigation 使用详解
- 让TextView 有滚动条的效果
- SQL中代替Like语句的函数charindex
- context:component-scan,spring注入
- 怎么做才能学好前端
- React Native Splashscreen实现
- 算法练习(二)
- [文件时间]_[Windows-macOS]_[修改文件的创建时间-修改时间]
- 第三方分享(友盟)
- SAP S/4 HANA的SMARTFORMS如何切换到非word编辑器
- 又好用又好装的PDF Expert
- shell 管理SpringBoot 生产环境服务 2
- linux中结束进程的两种方式:正常结束,异常结束
- opencv图像线性混合操作