react-native: using the expo fork. https://github.com/expo/react-native/archive/sdk-19.0.0.tar.gz
react: 16.0.0-alpha.12
native-base: 2.3.0
Header background color will change when toolbarDefaultBg is a different value when a new theme is passed to StyleProvider.
Background color is not updated.
Before toolbarDefaultBg update
After toolbarDefaultBg update
Here's some minimal code. You can find the repo here
function StyleComponent({ children, themeName }) {
const theme = Object.assign({}, Default, Custom[themeName]);
return <StyleProvider style={GetTheme(theme)} children={children} />;
}
function mapState({ settings }) {
return {
themeName: settings.theme
};
}
export default connect(mapState)(StyleComponent);
Look above! :)
I've only tried on iOS.
No. I'm going to fork and attempt to submit a PR.
Update from cardDefaultBg to toolbarDefaultBg, oops!
Same error on Android.
Sample Code:
<Header
backgroundColor="#00AA8D"
androidStatusBarColor='#008975'>
<Left>
<Button transparent>
<Icon name='menu' />
</Button>
</Left>
<Body>
<Title>Home</Title>
</Body>
<Right>
<Button transparent >
<Icon name='person' />
</Button>
</Right>
</Header>
Expected backgroundColor "#00AA8D"
Actual backgroundColor "blue" (default)
@naviens There is no prop as backgroundColor for Header.
@shivrajkumar: The documentation says that backgroundColor is a property of header: http://docs.nativebase.io/Components.html#header-def-headref
IMO, issue needs to be reopened since Im still facing it.
@amalantony #1619
@SupriyaKalghatgi thanks, it would be great if the documentation is updated to reflect the same.
@amalantony In my previous comment i have mentioned #1619 which has an issue opened on NB-Docs repo
Most helpful comment
Same error on Android.
Sample Code:
<Header backgroundColor="#00AA8D" androidStatusBarColor='#008975'> <Left> <Button transparent> <Icon name='menu' /> </Button> </Left> <Body> <Title>Home</Title> </Body> <Right> <Button transparent > <Icon name='person' /> </Button> </Right> </Header>Expected backgroundColor "#00AA8D"
Actual backgroundColor "blue" (default)