款式在阵营导航使用navigationOptions内标题对象的标题对象:
static navigationOptions = {
header: {
titleStyle: {
/* this only styles the title/text (font, color etc.) */
},
style: {
/* this will style the header, but does NOT change the text */
},
tintColor: {
/* this will color your back and forward arrows or left and right icons */
}
}
}
对于造型的backgroundColor
,你只需要设置你的应用程序中的backgroundColor
否则你会得到默认的颜色。
更新!随着2017年5月beta9的navigationOptions现在是平
您可以阅读有关重大更改的位置:https://github.com/react-community/react-navigation/releases/tag/v1.0.0-beta.9
你需要从标题对象中删除的对象键。另外,请注意它们已被重命名。
static navigationOptions = {
title: 'some string title',
headerTitleStyle: {
/* */
},
headerStyle: {
/* */
},
headerTintColor: {
/* */
},
}