欢迎页
    路由配置

    1. Welcome:{
    2. screen:welcomePage,
    3. navigationOptions:{
    4. header:null //去掉导航条
    5. }
    6. }

    welcome.js

    1. import React, { Component } from 'react';
    2. import { View, Text,Image,StyleSheet,Dimensions } from 'react-native';
    3. const {width,height,scale} =Dimensions.get('window') //获取高度宽度
    4. export default class welcomePage extends Component {
    5. render() {
    6. return (
    7. <View style={styles.container}>
    8. <Image style={styles.image} source={require("../assets/1.jpg")}/>
    9. <Button style={styles.btn} color="blue" title="跳过" onPress={this.toggledet}/>
    10. </View>
    11. );
    12. }
    13. componentDidMount(){
    14. this.timer = setTimeout(()=>{
    15. this.props.navigation.navigate("Home")
    16. },3000)
    17. }
    18. componentWillUnmount(){
    19. if(this.timer){
    20. clearTimeout(this.timer)
    21. }
    22. }
    23. toggledet=()=>{
    24. this.props.navigation.navigate("Home")
    25. }
    26. }
    27. const styles = StyleSheet.create({
    28. image:{
    29. width:width, //赋给图片
    30. height:height,
    31. }
    32. })

    去掉返回按钮

    1. navigationOptions:{
    2. headerTitle:"网易",
    3. headerLeft:null //去掉返回按钮
    4. }