美文网首页
顶部切换条ToTabNav.js

顶部切换条ToTabNav.js

作者: __MX | 来源:发表于2018-10-21 21:26 被阅读0次

yarn add react-navigation  //安装路由插件

//在util包下新建文件ToTabNav.js

import React, { Component } from "react";

import { createTabNavigator } from "react-navigation";

import List from "../util/List";  //加上list引用

import { createTabNavigator } from "react-navigation";  //加引用

//切换条组件

const Good = () => {

  return <List tab="good" />;

};

const Share = () => {

  return <List tab="share" />;

};

//切换条修改标题

const ToTabNav = createTabNavigator({

  Good: {

    screen: Good,

    navigationOptions: {

      title: "精华"

    }

  },

  Share: {

    screen: Share,

    navigationOptions: {

      title: "分享"

    }

  }

  }

});

export default ToTabNav;

//新建文件夹  建文件List rnc修改名字

//在ToTabNav.js  加List引用 

import List from "../util/List";

相关文章

网友评论

      本文标题:顶部切换条ToTabNav.js

      本文链接:https://www.haomeiwen.com/subject/kkvuzftx.html