react native ,1 新建页面并跳转
新建页面
1.新建文件
import React from 'react';
import { Text } from 'react-native';
export default class todayAttenScreen extends React.Component {
render() {
return <Text>我是个菜鸟</Text>
}
}
2.找到navigation下的MainTabNavigator.js文件定义
(1) import todayAtten from '引入的文件路径';
(2) 在export default createStackNavigator({]);中注册并初始化路由
todayAttenScreen: {screen: todayAtten, header: null}
3.跳转
this.props.navigation.replace('todayAttenScreen')
- 上一篇 »PHP弹出提示框并跳转到新页面即重定向到新页面
- 下一篇 »html5判断浏览器来源并跳转