import React, {Component} from 'react'; import { Text, View, ScrollView, TouchableOpacity, StyleSheet } from 'react-native'; export default class FirstTabScreen extends Component { static navigatorButtons = { leftButtons: [{ icon: require('../../img/navicon_menu.png'), id: 'menu' }], rightButtons: [ { title: 'Edit', id: 'edit' }, { icon: require('../../img/navicon_add.png'), id: 'add' } ] }; static navigatorStyle = { drawUnderTabBar: true }; constructor(props) { super(props); // if you want to listen on navigator events, set this up // this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this)); } onNavigatorEvent(event) { if (event.id == 'menu') { this.props.navigator.toggleDrawer({ side: 'left', animated: true }); } if (event.id == 'edit') { // AlertIOS.alert('NavBar', 'Edit button pressed'); } if (event.id == 'add') { // AlertIOS.alert('NavBar', 'Add button pressed'); } } render() { return ( Push Plain Screen Push Styled Screen Show Modal Screen Show LightBox ); } onPushPress() { this.props.navigator.push({ title: "More", screen: "example.PushedScreen" }); } onPushStyledPress() { console.warn('navigator.push not implemented yet'); // this.props.navigator.push({ // title: "Styled", // screen: "example.StyledScreen" // }); } onModalPress() { console.warn('navigator.showModal not implemented yet'); // this.props.navigator.showModal({ // title: "Modal", // screen: "example.ModalScreen" // }); } onLightBoxPress() { console.warn('navigator.showLightBox not implemented yet'); // this.props.navigator.showLightBox({ // screen: "example.LightBoxScreen", // style: { // backgroundBlur: "dark" // } // }); } } const styles = StyleSheet.create({ button: { textAlign: 'center', fontSize: 18, marginBottom: 10, marginTop:10, color: 'blue' } });