github url:https://github.com/aksonov/react-native-router-flux

API: https://github.com/aksonov/react-native-router-flux/blob/master/docs/API_CONFIGURATION.md

react-native-router-flux使用示例:

/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import {
AppRegistry,
View,
Text,
StyleSheet,
Image,
} from "react-native";
import React, { Component } from "react";
import {
Navigation,
Scene,
Router
} from 'react-native-router-flux';
import Index from './page/index';
import Me from './page/me';
import Info from './page/info';
import Type from './page/type';
import Car from './page/shopCar';
import Register from './page/register';
import Userinfo from './page/userinfo';
import Icon from 'react-native-vector-icons/FontAwesome';
class TabBar extends Component{
constructor(props){
super(props);
this.data={
index:{
title:"首页",
icon:"home",
},
type:{
title:"分类",
icon:"th-large",
},
car:{
title:"购物车",
icon:"shopping-cart",
},
me:{
title:"我的",
icon:"user",
}
}
}
render(){
let param=this.data[this.props.sceneKey];
let activeStyle=this.props.selected?{color:"#3399FF"}:{};
return <View>
<Icon name={param.icon} color={activeStyle.color} size={25}/>
<Text style={[activeStyle,styles.tabbarItem]}>{param.title}</Text>
</View>
}
}
class App extends Component {
constructor(props){
super(props);
}
render() {
const iconSize=30;
return (
<Router>
      {/*下部导航开始*/}
<Scene key="tabbar" name="tabbar" duration={0} tabs={true} style={styles.tabbarContainer} initial={true}>
<Scene key="index" duration={0} component={Index} title="首页" icon={TabBar} />
<Scene key="type" duration={0} component={Type} title="分类" icon={TabBar} />
<Scene key="car" duration={0} component={Car} title="购物车" icon={TabBar} />
<Scene key="me" duration={0} component={Me} hideNavBar={true} title="我的" icon={TabBar} />
</Scene>
      {/*下部导航结束*/}
<Scene key="info" duration={0} hideNavBar={true} component={Info} title="详情"></Scene>
<Scene key="register" duration={0} hideNavBar={true} component={Register} title="注册"></Scene>
<Scene key="userinfo" duration={0} component={Userinfo} title="用户详情"></Scene>
</Router>
)
}
}
var styles=StyleSheet.create({
tabbarContainer:{
flex:1,
backgroundColor:"#f6f6f6",
},
tabbarItem:{
alignItems:"center",
justifyContent:"center",
textAlign:"center",
marginLeft:-3
}
})
AppRegistry.registerComponent('reactApp', () => App);

react-native-router-flux 下部导航的更多相关文章

  1. 从零学React Native之03页面导航

    之前我们介绍了RN相关的知识: 是时候了解React Native了 从零学React Native之01创建第一个程序 从零学React Native之02状态机 本篇主要介绍页面导航 上一篇文章给 ...

  2. iOS程序员的React Native开发工具集

    本文整理了React Native iOS开发过程中有用的工具.服务.测试.库以及网站等. 工具 你可以选择不同的开发环境:DECO.EXPO或者你可以使用Nuclide+Atom,目前我使用EXPO ...

  3. React Native自定义导航栏

    之前我们学习了可触摸组件和页面导航的使用的使用: 从零学React Native之09可触摸组件 - 从零学React Native之03页面导航 - 经过之前的学习, 我们可以完成一个自定义导航栏了 ...

  4. React Native中自定义导航条

    这是2017年年初开始的公司的项目,对于导航条的要求很高,Android和iOS上必须用一致的UI,按钮位置还有各种颜色都有要求,而且要适应各种奇葩要求. 尝试了一下当时React Native自带的 ...

  5. iOS、swift、React Native学习常用的社区、论坛

    <!----iOS> <!----Swift>*IOS开发常用社区:http://code4app.com/ *IOS开发常用社区:http://www.cocoachina. ...

  6. React Native导航器之react-navigation使用

    在上一节Navigation组件,我们使用系统提供的导航组件做了一个跳转的例子,不过其实战能力不强,这里推荐一个超牛逼的第三方库:react-navigation.在讲react-navigation ...

  7. React Native 系列(八) -- 导航

    前言 本系列是基于React Native版本号0.44.3写的.我们都知道,一个App不可能只有一个不变的界面,而是通过多个界面间的跳转来呈现不同的内容.那么这篇文章将介绍RN中的导航. 导航 什么 ...

  8. React Native自定义导航条

    Navigator和NavigatorIOS 在开发中,需要实现多个界面的切换,这时候就需要一个导航控制器来进行各种效果的切换.在React Native中RN为我们提供了两个组件:Navigator ...

  9. React Native(四)——顶部以及底部导航栏实现方式

    效果图: 一步一步慢慢来: 其实刚入手做app的时候,就应该做出简单的顶部以及底部导航栏.无奈又在忙其他事情,导致这些现在才整理出来. 1.顶部导航栏:react-native-scrollable- ...

  10. react native 导航路由组件react-navigation的使用

    navigation的几个难点和问题: 1.底部tab是否可以加上中间的大按钮? 如果加上,如何触发事件? js文件放哪? 2.navigation的登录注册页面.成功后应该不能返回刚刚的登录页面?清 ...

随机推荐

  1. Dapper inner join

    Dapper中的一些复杂操作和inner join应该注意的坑 上一篇博文中我们快速的介绍了dapper的一些基本CURD操作,也是我们manipulate db不可或缺的最小单元,这一篇我们介绍下相 ...

  2. codevs 2188 最长上升子序列

    题目描述 Description LIS问题是最经典的动态规划基础问题之一.如果要求一个满足一定条件的最长上升子序列,你还能解决吗? 给出一个长度为N整数序列,请求出它的包含第K个元素的最长上升子序列 ...

  3. 浏览器的模式问题 Quirks Mode vs Standards Mode

    当微软开始产生与标准兼容的浏览器时,他们希望确保向后兼容性.为了实现这一点,他们IE6.0以后的版本在浏览器内嵌了两种表现模式: Standards Mode(标准模式或Strict Mode)和Qu ...

  4. PIL Image 转成 wx.Image、wx.Bitmap

    import wx from PIL import Image def ConvertToWxImage(): pilImage = Image.open('1.png') image = wx.Em ...

  5. winform拖动无边框窗体

    这个无边框拖动船体,代码很少,却总是记不住,于是就在网上搜了这段代码,记录一下,省的再忘 using System; using System.Collections.Generic; using S ...

  6. C语言学习笔记--类型定义&联合

    一.类型定义 C语言自定义数据类型 (typedef) C语言提供一个叫做typedef的功能来声明一个已有的数据类型的新名字. typedef int Length; 使得Length成为int类型 ...

  7. Hadoop 学习笔记(二) HDFS API

    4.删除HDFS上的文件 package proj; import java.io.IOException; import org.apache.hadoop.conf.Configuration; ...

  8. Develop a Packet Sniffer with libpcap

    Develop a Packet Sniffer with libpcap: http://vichargrave.com/develop-a-packet-sniffer-with-libpcap/

  9. QT美化界面的文章(真的很美)

    http://www.hookr.cn/tag/qt http://blog.csdn.net/yiyaaixuexi/article/category/758470 http://www.qtcn. ...

  10. 理解和使用NT驱动程序的执行上下文

    理解Windows NT驱动程序最重要的概念之一就是驱动程序运行时所处的“执行上下文”.理解并小心地应用这个概念可以帮助你构建更快.更高效的驱动程序. NT标准内核模式驱动程序编程的一个重要观念是某个 ...