import React, { Component } from 'react'; import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'; import { SlidingTabNavigation, SlidingTabNavigationItem, } from '@expo/ex-navigation'; import { Ionicons } from '@expo/vector-icons'; export default class SlidingTabNavigationExample extends Component { static route = { navigationBar: { title: 'Sliding Tab Navigation', ...SlidingTabNavigation.navigationBarStyles, }, }; _goToFirstTab = () => { this.props.navigation.performAction(({ tabs, stacks }) => { tabs('sliding-tab-navigation').jumpToTab('first'); }); }; _goToSecondTab = () => { this.props.navigation.performAction(({ tabs, stacks }) => { tabs('sliding-tab-navigation').jumpToTab('second'); }); }; _renderLabel = ({ route }) => { let title; if (route.key === 'first') { title = 'First'; } else if (route.key === 'second') { title = 'Second'; } return {title.toUpperCase()}; }; render() { return ( “ R2D2, you know better than to trust a strange computer! C3PO “ The best thing about a boolean is even if you are wrong, you are only off by a bit. Bryan ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fafafa', }, tabLabel: { margin: 8, fontSize: 13, color: '#fff', }, tabIndicator: { backgroundColor: '#FFEB3B', }, quoteContainer: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24, }, quoteMarks: { alignSelf: 'flex-start', color: '#E91E63', fontSize: 36, left: -8, bottom: -42, marginTop: -64, }, quoteText: { color: '#222', fontSize: 18, lineHeight: 27, textAlign: 'center', margin: 8, }, quoteAuthor: { color: '#888', fontSize: 12, fontStyle: 'italic', }, button: { margin: 16, color: '#0084FF', }, selectedTab: { backgroundColor: '#0084FF', }, });