react-native-router-flux 下部导航
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 下部导航的更多相关文章
- 从零学React Native之03页面导航
之前我们介绍了RN相关的知识: 是时候了解React Native了 从零学React Native之01创建第一个程序 从零学React Native之02状态机 本篇主要介绍页面导航 上一篇文章给 ...
- iOS程序员的React Native开发工具集
本文整理了React Native iOS开发过程中有用的工具.服务.测试.库以及网站等. 工具 你可以选择不同的开发环境:DECO.EXPO或者你可以使用Nuclide+Atom,目前我使用EXPO ...
- React Native自定义导航栏
之前我们学习了可触摸组件和页面导航的使用的使用: 从零学React Native之09可触摸组件 - 从零学React Native之03页面导航 - 经过之前的学习, 我们可以完成一个自定义导航栏了 ...
- React Native中自定义导航条
这是2017年年初开始的公司的项目,对于导航条的要求很高,Android和iOS上必须用一致的UI,按钮位置还有各种颜色都有要求,而且要适应各种奇葩要求. 尝试了一下当时React Native自带的 ...
- iOS、swift、React Native学习常用的社区、论坛
<!----iOS> <!----Swift>*IOS开发常用社区:http://code4app.com/ *IOS开发常用社区:http://www.cocoachina. ...
- React Native导航器之react-navigation使用
在上一节Navigation组件,我们使用系统提供的导航组件做了一个跳转的例子,不过其实战能力不强,这里推荐一个超牛逼的第三方库:react-navigation.在讲react-navigation ...
- React Native 系列(八) -- 导航
前言 本系列是基于React Native版本号0.44.3写的.我们都知道,一个App不可能只有一个不变的界面,而是通过多个界面间的跳转来呈现不同的内容.那么这篇文章将介绍RN中的导航. 导航 什么 ...
- React Native自定义导航条
Navigator和NavigatorIOS 在开发中,需要实现多个界面的切换,这时候就需要一个导航控制器来进行各种效果的切换.在React Native中RN为我们提供了两个组件:Navigator ...
- React Native(四)——顶部以及底部导航栏实现方式
效果图: 一步一步慢慢来: 其实刚入手做app的时候,就应该做出简单的顶部以及底部导航栏.无奈又在忙其他事情,导致这些现在才整理出来. 1.顶部导航栏:react-native-scrollable- ...
- react native 导航路由组件react-navigation的使用
navigation的几个难点和问题: 1.底部tab是否可以加上中间的大按钮? 如果加上,如何触发事件? js文件放哪? 2.navigation的登录注册页面.成功后应该不能返回刚刚的登录页面?清 ...
随机推荐
- net Core 使用MyCat分布式数据库,实现读写分离
net Core 使用MyCat分布式数据库,实现读写分离 目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 MyCat2.0版本很快就发布了,关于MyCat的动态和一些问题, ...
- Node.js 安装 初体验(1)
1.安装nodejs http://nodejs.org/download/ 自动根据系统下载自己的版本node.js 2.环境变量 windows 安装,不需要配置环境变量 mac安装后,会提 ...
- [Android] AudioTrack实例
AudioTrack在Android系统中是用于PCM数据的混音.播放,并不涉及到音频的解码.因此MP3这类经过编码的音频格式文件不能直接通过AudioTrack正确地播放,AudioTrack只能播 ...
- C#程序设计基础——数据类型
C#是强类型语言,因此每个变量和对象都必须具有声明类型.数据类型可描述为内置数据类型(如int或char),用户定义数据类型(如class或interface).数据类型还可以定义为值类型(用于存储值 ...
- html动态编辑框
简述: 随着在输入框中增加字符,动态矿高度增加(IE9及以上 chrome firefox) 由于IE8 不支持oninput函数,所以不能实现此效果 事件函数: function feedDivO ...
- sql(SqlServer)编程基本语法
一.定义变量 --简单赋值 declare @a int set @a=5 print @a --使用select语句赋值 declare @user1 nvarchar(50) select @ ...
- cf591A Wizards' Duel
A. Wizards' Duel time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
- ip地址中的网络号,主机号
当前使用的IP地址有4个字节(32bit)组成,即IPV4编码方式.每个IP地址包括两部分:网络号和主机号.当分配给主机号的二进制位越多,则能标识的主机数就越多,相应地能标识的网络数就越少,反之同理. ...
- ORACLE 索引概述
索引是数据库中一种可选的数据结构,她通常与表或簇相关.用户可以在表的一列或数列上建立索引,以提高在此表上执行 SQL 语句的性能.就像本文档的索引可以帮助读者快速定位所需信息一样,Oracle 的索引 ...
- linux下ssh使用和配置
常用格式:ssh [-l login_name] [-p port] [user@]hostname 更详细的可以用ssh -h查看. 举例 不指定用户: ssh 192.168.0.11 指定用户: ...