Not sure what exactly you are trying to do. To make tabBarIOS work, you need, as you say, start with
var { AppRegistry, StyleSheet, Text, View, NavigatorIOS, TabBarIOS, } = React;
Then create your class. Then create your own constructor that launches the tab that you want to select, then you need to create methods that modify the selected tab - when you select a bookmark, it is blue. then your render is returned with each TabBarIOS, inside each TabBarIOS.item, you must call the page where you want it to go to
class example extends React.Component{ constructor(props){ super(props) this.state = { selectedTab: 'sassi', } } homeHandleChange(){ this.setState({ selectedTab: 'home', }) }; aboutHandleChange(){ this.setState({ selectedTab: 'about', }) }; creditHandleChange(){ this.setState({ selectedTab: 'credits', }) }; render() { return ( <View style={styles.container}> <View style={styles.footer}> <TabBarIOS> <TabBarIOS.Item title="home List" selected={this.state.selectedTab === "home"} icon={require("./App/assets/youricon.png")} onPress={this.homeHandleChange.bind(this)} > <View style={styles.main}> <home></home> </View> </TabBarIOS.Item> <TabBarIOS.Item title="credits" selected={this.state.selectedTab === "credits"} icon={require("./App/assets/yourIcon.png")} onPress={this.creditsHandleChange.bind(this)} > <View style={styles.main}> <credits></credits> </View> </TabBarIOS.Item> <TabBarIOS.Item title="About" selected={this.state.selectedTab === "about"} icon={require("./App/assets/aboutIcon.png")} onPress={this.aboutHandleChange.bind(this)} > <View style={styles.main}> <About></About> </View> </TabBarIOS.Item> </TabBarIOS> </View> </View> ); } };
Adam katz
source share