2

我第一次尝试使用本机反应的任何类型的应用程序。我正在为组件/样式使用本机基础。我已经设法获得了一个非常基本的页面,但我试图弄清楚如何从这个页面转到一个页面,当从页脚中单击时,该页面会移动到不同的页面。

import React, { Component } from 'react';
import { Navigator, Container, Content, Header, Title, Button, Left, Right, Body, Icon, Footer, FooterTab } from 'native-base';
import { Col, Row, Grid } from 'react-native-easy-grid';

import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

export default class AwesomeNativeBase extends Component {
  render() {
    return (
      <Container>
          <Header>          
              <Body>
                  <Title>Kays Hairdressing</Title>
              </Body>
          </Header>
          <Content>
            <Grid>
                <Col style={{ backgroundColor: '#635DB7', height: 550 }}></Col>
                <Col style={{ backgroundColor: '#00CE9F', height: 550  }}></Col>
            </Grid>
          </Content>
          <Footer>
            <FooterTab>
                <Button>
                    <Text>Bookings</Text>
                    <Icon name="ios-book-outline" />
                </Button>
                <Button>
                    <Text>Blockout</Text>
                    <Icon name="ios-calendar-outline" />
                </Button>
            </FooterTab>
          </Footer>
      </Container>
    );
  }
}

AppRegistry.registerComponent('AwesomeNativeBase', () => AwesomeNativeBase);

我已经确定我需要使用“导航器”选项,但我无法让它工作,因为我不确定类在这个设置中是如何工作的。

4

2 回答 2

2

使用导航库,例如React NavigationReact Native Navigation

React Navigation 是基于 JavaScript 的选项,而 React 原生导航是更原生的实现

试一试

于 2017-06-07T14:08:19.153 回答
1

您应该使用 Tabs 组件进行屏幕导航(使用 tabBarPosition 定义选项卡放置),请参阅文档

我不知道为什么 FooterTab 仍然不支持屏幕导航。

于 2017-04-22T05:57:16.890 回答