Skip to content

Commit

Permalink
remove extra rnrf tab styling. user must pass tabBarStyle and tabBarS…
Browse files Browse the repository at this point in the history
…electedItemStyle explicitly (#839)
  • Loading branch information
joenoon authored and aksonov committed Jun 22, 2016
1 parent 1260168 commit b678de3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Example/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ class Right extends React.Component {

const styles = StyleSheet.create({
container: {flex:1, backgroundColor:"transparent",justifyContent: "center",
alignItems: "center",}

alignItems: "center",},
tabBarStyle: {
backgroundColor: '#eee',
},
tabBarSelectedItemStyle: {
backgroundColor: '#ddd',
},
});

const reducerCreate = params=>{
Expand Down Expand Up @@ -112,7 +117,7 @@ export default class Example extends React.Component {
<Scene key="loginModal3" hideNavBar={true} component={Login3} title="Login3" panHandlers={null} duration={1}/>
</Scene>
<Scene key="tabbar" component={NavigationDrawer}>
<Scene key="main" tabs={true} >
<Scene key="main" tabs={true} tabBarStyle={styles.tabBarStyle} tabBarSelectedItemStyle={styles.tabBarSelectedItemStyle}>
<Scene key="tab1" title="Tab #1" icon={TabIcon} navigationBarStyle={{backgroundColor:"red"}} titleStyle={{color:"white"}}>
<Scene key="tab1_1" component={TabView} title="Tab #1_1" onRight={()=>alert("Right button")} rightTitle="Right" />
<Scene key="tab1_2" component={TabView} title="Tab #1_2" titleStyle={{color:"black"}}/>
Expand Down
4 changes: 2 additions & 2 deletions src/TabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class TabBar extends Component {
/>
{!hideTabBar && state.children.filter(el => el.icon).length > 0 &&
<Tabs
style={[{ backgroundColor: 'white' }, state.tabBarStyle]}
selectedIconStyle={[{ backgroundColor: 'white' }, state.tabBarSelectedItemStyle]}
style={state.tabBarStyle}
selectedIconStyle={state.tabBarSelectedItemStyle}
onSelect={this.onSelect} {...state}
selected={state.children[state.index].sceneKey}
>
Expand Down

0 comments on commit b678de3

Please sign in to comment.