import React, {Component} from 'react'; import {View, Text, Image, StyleSheet} from 'react-native'; import TabNavigator from 'react-native-tab-navigator'; import Map from '../Map'; import Study from '../Study'; import Mine from '../Mine'; class Navigation extends Component { constructor(props) { super(props); this.state = {selectedTab: '地图'}; } render() { return ( ( )} renderSelectedIcon={() => ( )} onPress={() => { this.setState({selectedTab: '地图'}); this.props.changeName('地图'); }}> ( )} renderSelectedIcon={() => ( )} onPress={() => { this.setState({selectedTab: '自习'}); this.props.changeName('自习'); }}> ( )} renderSelectedIcon={() => ( )} onPress={() => { this.setState({selectedTab: '我'}); this.props.changeName('我'); }}> ); } } const styles = StyleSheet.create({ container: { backgroundColor: '#F2E2CE', //opacity: 0.5, flex: 1, }, icon: { height: 30, width: 40, }, tabText: { fontSize: 15, color: '#9f5022', // fontWeight: 'bold', textAlign: 'center', }, selectedTabText: { fontSize: 15, color: '#592202', fontWeight: 'bold', textAlign: 'center', }, }); export default Navigation;