Closed firashamila33 closed 6 years ago
the only solution that I found is to play with the title Style (backgrounColor, fontSize, color) which is not quite good , So I hope to find a better solution here my TabNavigator Component
<TabNavigator tabBarStyle={styles.tabBar}>
<TabNavigator.Item
title="Home"
titleStyle={{ backgroundColor: "transparent",
fontSize: parseInt(`${selectedTab === 'Home' ? 10 : 5}`),
color: `${this.state.selectedTab === 'Home' ? '#010a1c' : '#fbf9f0'}`,
}}
selectedTitleStyle={styles.tabTitleActive}
selected={selectedTab === 'Home'}
onPress={() => this.setState({selectedTab: 'Home'})}
renderIcon={() => <FeatherIcon name={'home'} selected={false}/> }
renderSelectedIcon={() => <FeatherIcon name={'home'} selected={true} /> }
>
<Home/>
</TabNavigator.Item>
<TabNavigator.Item
title="Profile"
titleStyle={{ backgroundColor: "transparent",
fontSize: parseInt(`${selectedTab === 'User' ? 10 : 5}`),
color: `${this.state.selectedTab === 'User' ? '#010a1c' : '#fbf9f0'}`,
}}
selectedTitleStyle={styles.tabTitleActive}
selected={selectedTab === 'User'}
onPress={() => this.setState({selectedTab: 'User'})}
renderIcon={() => <FeatherIcon name={'user'} selected={false}/> }
renderSelectedIcon={() => <FeatherIcon name={'user'} selected={true} /> }
>
<Profile/>
</TabNavigator.Item>
</TabNavigator>
Hello , I want to know how to display and show the the TabNavigator.Item title prop depending an if the item is selected or not
here my Tabnavigator